Class: ChalkRuby::LoggerHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/chalk_ruby/logger_helper.rb

Class Method Summary collapse

Class Method Details

.create(debug_file = nil) ⇒ Object

Parameters:

  • debug_file (nil|String) (defaults to: nil)

    file used to output the logs



7
8
9
10
11
12
# File 'lib/chalk_ruby/logger_helper.rb', line 7

def self.create(debug_file = nil)
  file              = debug_file || (ENV['CHALK_DEBUG'] ? File.new('debug.log') : $stderr)
  instance          = ::Logger.new file
  instance.progname = 'chalk'
  instance
end