class Rack::ODataCommonLogger

Constants

MSG_FUNC

Handle github.com/rack/rack/pull/1526 new in Rack 2.2.2 : Format has now 11 placeholders instead of 10

Public Instance Methods

batch_log(env, status, header, began_at) click to toggle source
# File lib/odata/common_logger.rb, line 46
def batch_log(env, status, header, began_at)
  length = extract_content_length(header)

  msg = MSG_FUNC.call(env, length, status, began_at)

  logger = @logger || env[RACK_ERRORS]
  # Standard library logger doesn't support write but it supports << which actually
  # calls to write on the log device without formatting
  if logger.respond_to?(:write)
    logger.write(msg)
  else
    logger << msg
  end
end
call(env) click to toggle source
Calls superclass method
# File lib/odata/common_logger.rb, line 5
def call(env)
  env['safrano.logger_mw'] = self
  super
end