Class: AnalyticsPSW::Rack::RequestLogger

Inherits:
Object
  • Object
show all
Includes:
RequestLogging
Defined in:
lib/analytics-psw/rack/request_logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RequestLogger

Returns a new instance of RequestLogger.



7
8
9
# File 'lib/analytics-psw/rack/request_logger.rb', line 7

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/analytics-psw/rack/request_logger.rb', line 11

def call(env)
  @status, headers, body = call_with_benchmark do
    @app.call(@env = env)
  end

  log_request

  [ @status, headers, body ]
end