Class: Logger

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

Defined Under Namespace

Modules: Colors

Instance Method Summary collapse

Instance Method Details

#format_message(level, *args) ⇒ Object


41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/logger/colors.rb', line 41

def format_message(level, *args)
  if Logger::Colors::SCHEMA[@logdev.dev]
    color = begin
      Logger::Colors.const_get \
        Logger::Colors::SCHEMA[@logdev.dev][Logger.const_get(level.sub "ANY","UNKNOWN")].to_s.upcase
    rescue NameError
      "0;0"
    end
    "\e[#{ color }m#{ format_message_colorless(level, *args) }\e[0;0m" 
  else
    format_message_colorless(level, *args)
  end
end

#format_message_colorlessObject


39
# File 'lib/logger/colors.rb', line 39

alias format_message_colorless format_message