Module: Creeper::ErrLogger
- Defined in:
- lib/creeper/err_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/err_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/err_logger.rb', line 6 def debug(string) Creeper.err_logger.debug(string) if Creeper.err_logger end |
.error(string) ⇒ Object
Send an error message
21 22 23 |
# File 'lib/creeper/err_logger.rb', line 21 def error(string) Creeper.err_logger.error(string) if Creeper.err_logger end |
.format_exception(exception) ⇒ Object
Format an exception message
32 33 34 35 |
# File 'lib/creeper/err_logger.rb', line 32 def format_exception(exception) str = "#{exception.class}: #{exception.to_s}\n" str << exception.backtrace.join("\n") end |
.info(string) ⇒ Object
Send a info message
11 12 13 |
# File 'lib/creeper/err_logger.rb', line 11 def info(string) Creeper.err_logger.info(string) if Creeper.err_logger end |
.warn(string) ⇒ Object
Send a warning message
16 17 18 |
# File 'lib/creeper/err_logger.rb', line 16 def warn(string) Creeper.err_logger.warn(string) if Creeper.err_logger end |