Class: Logger

Inherits:
Object show all
Includes:
LoggerHelpers
Defined in:
lib/runtime/logging.rb

Overview

Monkey-patch the built-in Ruby Logger class to support implicit backtrace printing TODO: Figure out if this is actually useful.

Instance Method Summary collapse

Methods included from LoggerHelpers

#extract_backtrace, #generate_message

Instance Method Details

#error(error_or_message, error = nil) ⇒ Object



88
89
90
91
92
93
# File 'lib/runtime/logging.rb', line 88

def error(error_or_message, error = nil)
  warn error_or_message
  return extract_backtrace(error_or_message) if error.nil?
  original_error(generate_message(error_or_message, error))
  extract_backtrace(original_error(error))
end

#original_errorObject



87
# File 'lib/runtime/logging.rb', line 87

alias original_error error