Class: Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/advanced_ruby_command_handler/logger.rb

Constant Summary collapse

COLORS =
{
  :default => "\e[38m",
  :white => "\e[39m",
  :black => "\e[30m",
  :red => "\e[31m",
  :green => "\e[32m",
  :brown => "\e[33m",
  :blue => "\e[34m",
  :magenta => "\e[35m",
  :cyan => "\e[36m",
  :gray => "\e[37m",
  :yellow => "\e[33m"
}.freeze
MODES =
{
  :info => :cyan,
  :error => :red,
  :warn => :yellow,
  :check => :green
}.freeze

Class Method Summary collapse

Class Method Details

.console_color(color, message) ⇒ Object



25
26
27
# File 'lib/advanced_ruby_command_handler/logger.rb', line 25

def console_color(color, message)
  "#{COLORS[color]}#{message}\e[0m"
end