Class: AnalyticsPSW::Rack::RequestLogger
- Inherits:
-
Object
- Object
- AnalyticsPSW::Rack::RequestLogger
- Includes:
- RequestLogging
- Defined in:
- lib/analytics-psw/rack/request_logger.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ RequestLogger
constructor
A new instance of RequestLogger.
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 |