Module: Qu::Logger

Included in:
Backend::Base, Payload, Worker
Defined in:
lib/qu/logger.rb

Instance Method Summary collapse

Instance Method Details

#clean_backtrace(exception) ⇒ Object



13
14
15
16
17
# File 'lib/qu/logger.rb', line 13

def clean_backtrace(exception)
  defined?(Rails) && Rails.respond_to?(:backtrace_cleaner) ?
    Rails.backtrace_cleaner.clean(exception.backtrace) :
    exception.backtrace
end

#log_exception(exception) ⇒ Object



7
8
9
10
11
# File 'lib/qu/logger.rb', line 7

def log_exception(exception)
  message = "\n#{exception.class} (#{exception.message}):\n  "
  message << clean_backtrace(exception).join("\n  ") << "\n\n"
  logger.fatal(message)
end

#loggerObject



3
4
5
# File 'lib/qu/logger.rb', line 3

def logger
  Qu.logger
end