Class: DailyLogger::Formatter
- Inherits:
-
Object
- Object
- DailyLogger::Formatter
- Defined in:
- lib/daily_logger/formatter.rb
Overview
Default formatter for log messages
Constant Summary collapse
- Format =
"[%s]\t%s\n"
Instance Attribute Summary collapse
-
#datetime_format ⇒ Object
Returns the value of attribute datetime_format.
Instance Method Summary collapse
- #call(time, msg, block_msg) ⇒ Object
-
#initialize ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize ⇒ Formatter
Returns a new instance of Formatter.
8 9 10 |
# File 'lib/daily_logger/formatter.rb', line 8 def initialize @datetime_format = nil end |
Instance Attribute Details
#datetime_format ⇒ Object
Returns the value of attribute datetime_format.
6 7 8 |
# File 'lib/daily_logger/formatter.rb', line 6 def datetime_format @datetime_format end |
Instance Method Details
#call(time, msg, block_msg) ⇒ Object
12 13 14 |
# File 'lib/daily_logger/formatter.rb', line 12 def call(time, msg, block_msg) Format % [format_datetime(time), make_msg(msg, block_msg)] end |