ANSI color log formatter. Outputs log messages color-coded by their severity if the current terminal appears to support it.
Pattern for matching color terminals
ANSI color escapes keyed by severity
ANSI reset
Format the specified msg for output to the log.
# File lib/loggability/formatter/color.rb, line 42 def msg2str( msg, severity ) msg = super if @color_enabled color = severity.downcase.to_sym msg = [ LEVEL_CODES[color], msg, RESET ].join( '' ) end return msg end
Generated with the Darkfish Rdoc Generator 2.