Class: Rack::XrkLog::CommonLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/xrk/log/commonlogger.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ CommonLogger

Returns a new instance of CommonLogger.



8
9
10
11
# File 'lib/rack/xrk/log/commonlogger.rb', line 8

def initialize(app)
  @app = app
  @dispose = Dispose.new(@app)
end

Instance Method Details

#call(env) ⇒ Object



13
14
15
16
17
18
# File 'lib/rack/xrk/log/commonlogger.rb', line 13

def call(env)
  @dispose.begin_at = DateTime.now.strftime("%Q").to_i
  status, header, body = @app.call(env)
  @dispose.write(env, body, status, header) rescue nil
  [status, header, body]
end