Sha256: 5b00bfd40cfc126fd74739b78d75008081745b2b9dc9b89c7087cc2104a2c135

Contents?: true

Size: 749 Bytes

Versions: 15

Compression:

Stored size: 749 Bytes

Contents

module FbGraph
  module Debugger
    class RequestFilter
      # Callback called in HTTPClient (before sending a request)
      # request:: HTTP::Message
      def filter_request(request)
        started = "======= [FbGraph] API REQUEST STARTED ======="
        log started, request.dump
      end

      # Callback called in HTTPClient (after received a response)
      # request::  HTTP::Message
      # response:: HTTP::Message
      def filter_response(request, response)
        finished = "======= [FbGraph] API REQUEST FINISHED ======="
        log '-' * 50, response.dump, finished
      end

      private

      def log(*outputs)
        outputs.each do |output|
          FbGraph.logger.info output
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
fb_graph-2.7.8 lib/fb_graph/debugger.rb
fb_graph-2.7.7 lib/fb_graph/debugger.rb
fb_graph-2.7.6 lib/fb_graph/debugger.rb
fb_graph-2.7.5 lib/fb_graph/debugger.rb
fb_graph-2.7.4 lib/fb_graph/debugger.rb
fb_graph-2.7.3 lib/fb_graph/debugger.rb
fb_graph-2.7.2 lib/fb_graph/debugger.rb
fb_graph-2.7.1 lib/fb_graph/debugger.rb
fb_graph-2.7.0 lib/fb_graph/debugger.rb
fb_graph-2.6.7 lib/fb_graph/debugger.rb
fb_graph-2.6.6 lib/fb_graph/debugger.rb
fb_graph-2.6.5 lib/fb_graph/debugger.rb
fb_graph-2.6.4 lib/fb_graph/debugger.rb
fb_graph-2.6.3 lib/fb_graph/debugger.rb
fb_graph-2.6.2 lib/fb_graph/debugger.rb