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