Set color by using a
symbol or one of the defined constants. Set modes by specifying bold,
italic, or underline options. Inspired by Highline, this method will
automatically clear formatting at the end of the returned String.
# File activesupport/lib/active_support/log_subscriber.rb, line 175
def color(text, color, mode_options = {}) # :doc:
return text unless colorize_logging
color = self.class.const_get(color.upcase) if color.is_a?(Symbol)
mode = mode_from(mode_options)
clear = "\e[#{MODES[:clear]}m"
"#{mode}#{color}#{text}#{clear}"
end