Class: Zabbirc::Logger::Formatter
- Inherits:
-
Object
- Object
- Zabbirc::Logger::Formatter
- Defined in:
- lib/zabbirc/logger.rb
Constant Summary collapse
- Format =
"%s, [%s#%d T%d] %5s -- %s: %s\n"
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.
14 15 16 |
# File 'lib/zabbirc/logger.rb', line 14 def initialize @datetime_format = nil end |
Instance Attribute Details
#datetime_format ⇒ Object
Returns the value of attribute datetime_format.
12 13 14 |
# File 'lib/zabbirc/logger.rb', line 12 def datetime_format @datetime_format end |
Instance Method Details
#call(severity, time, progname, msg) ⇒ Object
18 19 20 |
# File 'lib/zabbirc/logger.rb', line 18 def call(severity, time, progname, msg) Format % [severity[0..0], format_datetime(time), $$, Thread.current.object_id, severity, progname, msg2str(msg)] end |