Class: Magpie::Mothlog
- Inherits:
-
Object
- Object
- Magpie::Mothlog
- Defined in:
- lib/middles/mothlog.rb
Constant Summary collapse
- FORMAT =
%{%s : "%s" \n}
- FORMAT_NOTIFY =
%{\t[%s] %s at[%s] (%0.4fms)\nParameters:%s\nResult:%s\n}
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, logger = nil) ⇒ Mothlog
constructor
A new instance of Mothlog.
Constructor Details
#initialize(app, logger = nil) ⇒ Mothlog
Returns a new instance of Mothlog.
8 9 10 11 |
# File 'lib/middles/mothlog.rb', line 8 def initialize(app, logger=nil) @app = app @logger = logger end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 |
# File 'lib/middles/mothlog.rb', line 13 def call(env) status, header, body = @app.call(env) log(env) [status, header, body] end |