Class: Namira::Middleware::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/namira/middleware/logger.rb

Overview

Performs request logging

Constant Summary collapse

SKIP_LOGGING_KEY =

The key that will disable logging

:skip_logging

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Logger

Returns a new instance of Logger.



10
11
12
# File 'lib/namira/middleware/logger.rb', line 10

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object

Called by the middleware runner.

Parameters:



18
19
20
21
# File 'lib/namira/middleware/logger.rb', line 18

def call(env)
  log_request(env)
  @app.call(env)
end