Class: Cinch::Logger::FormattedLogger
- Inherits:
-
Cinch::Logger
- Object
- Cinch::Logger
- Cinch::Logger::FormattedLogger
- Defined in:
- lib/cinch/logger/formatted_logger.rb
Overview
Constant Summary collapse
- COLORS =
{ reset: "\e[0m", bold: "\e[1m", red: "\e[31m", green: "\e[32m", yellow: "\e[33m", blue: "\e[34m", black: "\e[30m", bg_white: "\e[47m" }
Constants inherited from Cinch::Logger
Instance Attribute Summary
Attributes inherited from Cinch::Logger
Instance Method Summary collapse
-
#exception(e) ⇒ void
Logs an exception.
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) ⇒ void
This method returns an undefined value.
Logs an exception.
22 23 24 25 26 |
# File 'lib/cinch/logger/formatted_logger.rb', line 22 def exception(e) lines = ["#{e.backtrace.first}: #{e.} (#{e.class})"] lines.concat e.backtrace[1..].map { |s| "\t" + s } log(lines, :exception, :error) end |