Module: Dexter::Logging
Constant Summary collapse
- COLOR_CODES =
{ red: 31, green: 32, yellow: 33, cyan: 36 }
Instance Method Summary collapse
Instance Method Details
#colorize(message, color) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/dexter/logging.rb', line 18 def colorize(, color) if output.tty? "\e[#{COLOR_CODES[color]}m#{}\e[0m" else end end |
#log(message = "") ⇒ Object
14 15 16 |
# File 'lib/dexter/logging.rb', line 14 def log( = "") output.puts() unless $log_level == "error" end |
#output ⇒ Object
10 11 12 |
# File 'lib/dexter/logging.rb', line 10 def output $stdout end |