Class: Lumberjack::Formatter::ExceptionFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/lumberjack/formatter/exception_formatter.rb

Overview

Format an exception including the backtrace.

Instance Method Summary collapse

Instance Method Details

#call(exception) ⇒ Object



5
6
7
8
9
# File 'lib/lumberjack/formatter/exception_formatter.rb', line 5

def call(exception)
  message = "#{exception.class.name}: #{exception.message}"
  message << "#{Lumberjack::LINE_SEPARATOR}  #{exception.backtrace.join("#{Lumberjack::LINE_SEPARATOR}  ")}" if exception.backtrace
  message
end