Module: Cuporter::Logging
Instance Attribute Summary collapse
-
#output_home ⇒ Object
Returns the value of attribute output_home.
Instance Method Summary collapse
Instance Attribute Details
#output_home ⇒ Object
Returns the value of attribute output_home.
10 11 12 |
# File 'lib/cuporter/logging.rb', line 10 def output_home @output_home end |
Instance Method Details
#error_log_file ⇒ Object
24 25 26 |
# File 'lib/cuporter/logging.rb', line 24 def error_log_file File.open(File.join(output_home || '.', 'cuporter_errors.log'), 'a') end |
#error_logger ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cuporter/logging.rb', line 12 def error_logger @error_logger ||= begin require "logger" logger = ::Logger.new(error_log_file) logger.level = ::Logger::WARN logger.formatter = proc { |severity, datetime, progname, msg| "#{severity} #{datetime.strftime('%b-%d-%y %H:%M:%S')} #{msg}\n\n" } logger end end |