Class: Hoodie::Formatter

Inherits:
Logger::Formatter
  • Object
show all
Defined in:
lib/hoodie/logging.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFormatter

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_formatObject

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