Class: Patron::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/http_event_logger/adapter/patron.rb

Instance Method Summary collapse

Instance Method Details

#request_with_logging(action_name, url, headers, options = {}) ⇒ Object


5
6
7
8
9
10
11
12
13
# File 'lib/http_event_logger/adapter/patron.rb', line 5

def request_with_logging(action_name, url, headers, options={})
  create_request_event(action_name, headers, options, url)
  response = nil
  time_taken_in_seconds = ::Benchmark.realtime do
    response = request_without_logging(action_name, url, headers, options)
  end
  create_response_event(response, time_taken_in_seconds)
  response
end