Class: Logger::Formatter
- Inherits:
-
Object
- Object
- Logger::Formatter
- Defined in:
- lib/logger.rb
Overview
Default formatter for log messages.
Constant Summary collapse
- Format =
"%s, [%s#%d] %5s -- %s: %s\n".freeze
Instance Attribute Summary collapse
-
#datetime_format ⇒ Object
Returns the value of attribute datetime_format.
Instance Method Summary collapse
- #call(severity, time, progname, msg) ⇒ Object
-
#initialize ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize ⇒ Formatter
Returns a new instance of Formatter.
556 557 558 |
# File 'lib/logger.rb', line 556 def initialize @datetime_format = nil end |
Instance Attribute Details
#datetime_format ⇒ Object
Returns the value of attribute datetime_format
554 555 556 |
# File 'lib/logger.rb', line 554 def datetime_format @datetime_format end |
Instance Method Details
#call(severity, time, progname, msg) ⇒ Object
560 561 562 563 |
# File 'lib/logger.rb', line 560 def call(severity, time, progname, msg) Format % [severity[0..0], format_datetime(time), $$, severity, progname, msg2str(msg)] end |