class Sneakers::ErrorReporter::DefaultLogger

Public Instance Methods

call(exception, worker, context_hash) click to toggle source
# File lib/sneakers/error_reporter.rb, line 5
def call(exception, worker, context_hash)
  Sneakers.logger.warn(context_hash) unless context_hash.empty?
  log_string = ''
  log_string += "[Exception error=#{exception.message.inspect} error_class=#{exception.class} worker_class=#{worker.class}"  unless exception.nil?
  log_string += " backtrace=#{exception.backtrace.take(50).join(',')}" unless exception.nil? || exception.backtrace.nil?
  log_string += ']'
  Sneakers.logger.error log_string
end