Class: Rack::SimpleLogger
- Inherits:
-
Object
- Object
- Rack::SimpleLogger
- Defined in:
- lib/rack/simple_logger.rb,
lib/rack/simple_logger/version.rb
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ SimpleLogger
constructor
A new instance of SimpleLogger.
Constructor Details
#initialize(app, options = {}) ⇒ SimpleLogger
10 11 12 13 14 |
# File 'lib/rack/simple_logger.rb', line 10 def initialize(app, ={}) [:log] ||= STDOUT @logger = LogProxy.new([:log]) @app = app end |
Instance Method Details
#call(env) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/rack/simple_logger.rb', line 16 def call(env) began_at = Time.now status, header, body = @app.call(env) log(env, status, header, began_at) [status, header, body] end |