Parent

Methods

Rack::CommonLogger

Patch CommonLogger to use after_reply.

Simply request this file and CommonLogger will be a bit more efficient.

Public Instance Methods

call(env) click to toggle source
# File lib/puma/rack_patch.rb, line 11
def call(env)
  began_at = Time.now
  status, header, body = @app.call(env)
  header = Utils::HeaderHash.new(header)

  if ary = env['rack.after_reply']
    ary << lambda { log(env, status, header, began_at) }
  else
    body = BodyProxy.new(body) { log(env, status, header, began_at) }
  end

  [status, header, body]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.