Class: Populus::DefaultLoggerFormatter

Inherits:
Logger::Formatter
  • Object
show all
Defined in:
lib/populus/default_logger.rb

Constant Summary collapse

COLOR_CODE =
{
  'DEBUG' => :black,
  'INFO'  => :green,
  'WARN'  => :yellow,
  'ERROR' => :red,
  'FATAL' => :magenta,
}

Instance Method Summary collapse

Instance Method Details

#call(severity, time, progname, msg) ⇒ Object



13
14
15
16
17
# File 'lib/populus/default_logger.rb', line 13

def call(severity, time, progname, msg)
  s = super
  s[0] = ("%5s" % severity).colorize(:color => COLOR_CODE[severity])
  s
end