Method: Cinch::Logger::FormattedLogger#exception

Defined in:
lib/cinch/logger/formatted_logger.rb

#exception(e) ⇒ void

This method returns an undefined value.

Logs an exception.

Parameters:

Since:

  • 2.0.0



22
23
24
25
26
# File 'lib/cinch/logger/formatted_logger.rb', line 22

def exception(e)
  lines = ["#{e.backtrace.first}: #{e.message} (#{e.class})"]
  lines.concat e.backtrace[1..].map { |s| "\t" + s }
  log(lines, :exception, :error)
end