Sha256: bc6f9cfd612e364b7902eb79b476c7a3259574be5343fe8c66dc50b45651d844

Contents?: true

Size: 515 Bytes

Versions: 62

Compression:

Stored size: 515 Bytes

Contents

module ActiveResource
  class DetailedLogSubscriber < ActiveSupport::LogSubscriber
    def request(event)
      data = event.payload[:data]
      headers = data.extract_options!
      request_body = data.first

      info "Request:\n#{request_body}" if request_body
      info "Headers: #{headers.inspect}"
      info "Response:\n#{event.payload[:response].body}"
    end

    def logger
      ActiveResource::Base.logger
    end
  end
end

ActiveResource::DetailedLogSubscriber.attach_to :active_resource_detailed

Version data entries

62 entries across 62 versions & 3 rubygems

Version Path
shopify_api-5.2.0 lib/active_resource/detailed_log_subscriber.rb
shopify_api-5.1.0 lib/active_resource/detailed_log_subscriber.rb
shopify_api-5.0.0 lib/active_resource/detailed_log_subscriber.rb
spiffy_stores_api-4.11.1 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.13.0 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.12.0 lib/active_resource/detailed_log_subscriber.rb
spiffy_stores_api-4.11.0 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.11.0 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.10.0 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.9.1 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.9.0 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.8.0 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.7.1 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.7.0 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.6.0 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.5.0 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.4.0 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.3.9 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.3.8 lib/active_resource/detailed_log_subscriber.rb
shopify_api-4.3.7 lib/active_resource/detailed_log_subscriber.rb