Sha256: b1594942a6d532a4f66610e6603f138d71fb52ca75c8a830fa731834ca0cd780

Contents?: true

Size: 437 Bytes

Versions: 3

Compression:

Stored size: 437 Bytes

Contents

module ActiveResource
  module Railties
    class LogSubscriber < Rails::LogSubscriber
      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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
activeresource-3.0.0.beta4 lib/active_resource/railties/log_subscriber.rb
activeresource-3.0.0.beta3 lib/active_resource/railties/log_subscriber.rb
activeresource-3.0.0.beta2 lib/active_resource/railties/log_subscriber.rb