Class: Logger
- Inherits:
-
Object
- Object
- Logger
- Defined in:
- lib/bicho/ext/logger_colors.rb
Overview
Utility class to color output.
Defined Under Namespace
Modules: Colors
Instance Method Summary collapse
Instance Method Details
#format_message(level, *args) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/bicho/ext/logger_colors.rb', line 39 def (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#{(level, *args)}\e[0;0m" else (level, *args) end end |
#format_message_colorless ⇒ Object
37 |
# File 'lib/bicho/ext/logger_colors.rb', line 37 alias |