aboutsummaryrefslogblamecommitdiffstats
path: root/activeresource/lib/active_resource/railties/subscriber.rb
blob: fb98061b7163b5c99a62865aedf39541ad158738 (plain) (tree)
1
2
3
4
5
6



                                        

                                                                                   








                                                                                                             
module ActiveResource
  module Railties
    class Subscriber < Rails::Subscriber
      def request(event)
        result = event.payload[:result]
        info "#{event.payload[:method].to_s.upcase} #{event.payload[:request_uri]}"
        info "--> %d %s %d (%.1fms)" % [result.code, result.message, result.body.to_s.length, event.duration]
      end

      def logger
        ActiveResource::Base.logger
      end
    end
  end
end