Class: Deas::SummaryLogging
- Inherits:
-
BaseLogging
- Object
- BaseLogging
- Deas::SummaryLogging
- Defined in:
- lib/deas/logging.rb
Instance Method Summary collapse
-
#call!(env) ⇒ Object
This the real Rack call interface.
Methods inherited from BaseLogging
#call, #initialize, #log, #log_error
Constructor Details
This class inherits a constructor from Deas::BaseLogging
Instance Method Details
#call!(env) ⇒ Object
This the real Rack call interface. It adds logging after super-ing to the common logging behavior.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/deas/logging.rb', line 92 def call!(env) env['deas.logging'] = Proc.new{ |msg| } # no-op status, headers, body = super(env) request = Rack::Request.new(env) log SummaryLine.new({ 'method' => request.request_method, 'path' => request.path, 'handler' => env['deas.handler_class'], 'params' => env['sinatra.params'], 'time' => env['deas.time_taken'], 'status' => status }) [ status, headers, body ] end |