Class: Sneakers::ErrorReporter::DefaultLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/sneakers/error_reporter.rb

Instance Method Summary collapse

Instance Method Details

#call(exception, worker, context_hash) ⇒ Object



5
6
7
8
9
10
11
12
# 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