Class: Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/bicho/ext/logger_colors.rb,
lib/bicho/ext/logger_colors.rb

Defined Under Namespace

Modules: Colors

Instance Method Summary (collapse)

Instance Method Details

- (Object) format_message(level, *args)



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/bicho/ext/logger_colors.rb', line 38

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

- (Object) format_message_colorless



36
# File 'lib/bicho/ext/logger_colors.rb', line 36

alias format_message_colorless format_message