Class: Cinch::Logger::FormattedLogger

Inherits:
Cinch::Logger show all
Defined in:
lib/cinch/logger/formatted_logger.rb

Overview

Version:

  • 2.0.0

Instance Attribute Summary

Attributes inherited from Cinch::Logger

#level, #mutex, #output

Instance Method Summary collapse

Methods inherited from Cinch::Logger

#debug, #error, #fatal, #incoming, #info, #initialize, #log, #outgoing, #warn, #will_log?

Constructor Details

This class inherits a constructor from Cinch::Logger

Instance Method Details

#exception(e)

This method returns an undefined value.

Logs an exception.

Since:

  • 2.0.0


20
21
22
23
24
# File 'lib/cinch/logger/formatted_logger.rb', line 20

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