Class: Hoodie::Formatter
- Defined in:
- lib/hoodie/logging.rb
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.
90 91 92 93 |
# File 'lib/hoodie/logging.rb', line 90 def initialize @datetime_format = nil super end |
Instance Attribute Details
#datetime_format ⇒ Object
Returns the value of attribute datetime_format.
88 89 90 |
# File 'lib/hoodie/logging.rb', line 88 def datetime_format @datetime_format end |
Instance Method Details
#call(severity, time, progname, msg) ⇒ Object
95 96 97 98 99 100 101 |
# File 'lib/hoodie/logging.rb', line 95 def call(severity, time, progname, msg) format % [ format_datetime(time).blue, severity.green, msg2str(msg).strip.orange ] end |