Class: Logger::Formatter

Inherits:
Object show all
Defined in:
lib/active_support/core_ext/logger.rb

Direct Known Subclasses

SimpleFormatter

Constant Summary collapse

Format =
"%s, [%s#%d] %5s -- %s: %s\n"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFormatter

Returns a new instance of Formatter.



80
81
82
# File 'lib/active_support/core_ext/logger.rb', line 80

def initialize
  @datetime_format = nil
end

Instance Attribute Details

#datetime_formatObject

Returns the value of attribute datetime_format.



78
79
80
# File 'lib/active_support/core_ext/logger.rb', line 78

def datetime_format
  @datetime_format
end

Instance Method Details

#call(severity, time, progname, msg) ⇒ Object



84
85
86
87
# File 'lib/active_support/core_ext/logger.rb', line 84

def call(severity, time, progname, msg)
  Format % [severity[0..0], format_datetime(time), $$, severity, progname,
  msg2str(msg)]
end