Class: DevSuite::RequestLogger::Adapter::Middleware::Faraday

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/dev_suite/request_logger/adapter/middleware/faraday.rb

Instance Method Summary collapse

Instance Method Details

#call(env, instance = nil) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/dev_suite/request_logger/adapter/middleware/faraday.rb', line 8

def call(env, instance = nil)
  # Log the request details
  Logger.log_request(instance, env)

  # Perform the actual request
  @app.call(env).on_complete do |response_env|
    # Log the response details
    Logger.log_response(instance, response_env)
  end
end