Class: Loga::Rack::Logger
- Inherits:
-
Object
- Object
- Loga::Rack::Logger
- Includes:
- Utilities
- Defined in:
- lib/loga/rack/logger.rb
Instance Method Summary collapse
- #call(env, started_at = Time.now) ⇒ Object
-
#initialize(app) ⇒ Logger
constructor
A new instance of Logger.
Methods included from Utilities
Constructor Details
#initialize(app) ⇒ Logger
Returns a new instance of Logger.
6 7 8 |
# File 'lib/loga/rack/logger.rb', line 6 def initialize(app) @app = app end |
Instance Method Details
#call(env, started_at = Time.now) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/loga/rack/logger.rb', line 10 def call(env, started_at = Time.now) request = Loga::Rack::Request.new(env) env['loga.request.original_path'] = request.path if logger.respond_to?(:tagged) logger.tagged((request)) { call_app(request, env, started_at) } else call_app(request, env, started_at) end end |