Class: RCoLi::Log
Instance Method Summary collapse
-
#initialize ⇒ Log
constructor
A new instance of Log.
- #logger ⇒ Object
Constructor Details
#initialize ⇒ Log
Returns a new instance of Log.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rcoli/utils.rb', line 24 def initialize @log = Logger.new(STDOUT) @log.level = Logger::INFO @log.formatter = proc do |severity, datetime, progname, msg| case severity when "DEBUG" color = 'gray27' else color = :white end if STDOUT.tty? Paint["#{msg}\n", color] else "#{msg}\n" end end end |
Instance Method Details
#logger ⇒ Object
44 45 46 |
# File 'lib/rcoli/utils.rb', line 44 def logger @log end |