module YleTf::Logger::Colorize

Constants

COLORS

Public Class Methods

colorize(msg, color) click to toggle source

Wraps the message with the specified ANSI color code if the color is specified and supported

# File lib/yle_tf/logger/colorize.rb, line 18
def self.colorize(msg, color)
  code = COLORS[color]
  code ? "\033[#{code}m#{msg}\033[0m" : msg
end