Module: Creeper::Logger
- Defined in:
- lib/creeper/logger.rb
Class Method Summary collapse
-
.crash(string, exception) ⇒ Object
Handle a crash.
-
.debug(string) ⇒ Object
Send a debug message.
-
.error(string) ⇒ Object
Send an error message.
-
.format_exception(exception) ⇒ Object
Format an exception message.
-
.info(string) ⇒ Object
Send a info message.
-
.warn(string) ⇒ Object
Send a warning message.
Class Method Details
.crash(string, exception) ⇒ Object
Handle a crash
26 27 28 29 |
# File 'lib/creeper/logger.rb', line 26 def crash(string, exception) string << "\n" << format_exception(exception) error string end |
.debug(string) ⇒ Object
Send a debug message
6 7 8 |
# File 'lib/creeper/logger.rb', line 6 def debug(string) Creeper.logger.debug(string) if Creeper.logger end |
.error(string) ⇒ Object
Send an error message
21 22 23 |
# File 'lib/creeper/logger.rb', line 21 def error(string) Creeper.error_logger.error(string) if Creeper.error_logger end |
.format_exception(exception) ⇒ Object
Format an exception message
32 33 34 35 |
# File 'lib/creeper/logger.rb', line 32 def format_exception(exception) str = "#{exception.class}: #{exception.to_s}\n" str << exception.backtrace.join("\n") end |