Sha256: 76133e2def64414450a19247ca24cd3e56864bb9120aad713171f17d650568c2

Contents?: true

Size: 657 Bytes

Versions: 16

Compression:

Stored size: 657 Bytes

Contents

module SWD
  module Debugger
    class RequestFilter
      # Callback called in HTTPClient (before sending a request)
      # request:: HTTP::Message
      def filter_request(request)
        started = "======= [SWD] HTTP REQUEST STARTED ======="
        SWD.logger.info [started, request.dump].join("\n")
      end

      # Callback called in HTTPClient (after received a response)
      # request::  HTTP::Message
      # response:: HTTP::Message
      def filter_response(request, response)
        finished = "======= [SWD] HTTP REQUEST FINISHED ======="
        SWD.logger.info ['-' * 50, response.dump, finished].join("\n")
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
swd-1.3.0 lib/swd/debugger/request_filter.rb
swd-1.2.0 lib/swd/debugger/request_filter.rb
swd-1.1.2 lib/swd/debugger/request_filter.rb
swd-1.1.1 lib/swd/debugger/request_filter.rb
swd-1.1.0 lib/swd/debugger/request_filter.rb
swd-1.0.1 lib/swd/debugger/request_filter.rb
swd-1.0.0 lib/swd/debugger/request_filter.rb
swd-0.2.1 lib/swd/debugger/request_filter.rb
swd-0.2.0 lib/swd/debugger/request_filter.rb
swd-0.1.2 lib/swd/debugger/request_filter.rb
swd-0.1.1 lib/swd/debugger/request_filter.rb
swd-0.1.0 lib/swd/debugger/request_filter.rb
swd-0.0.9 lib/swd/debugger/request_filter.rb
swd-0.0.8 lib/swd/debugger/request_filter.rb
swd-0.0.7 lib/swd/debugger/request_filter.rb
swd-0.0.6 lib/swd/debugger/request_filter.rb