Module: Creeper::OutLogger
Instance 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.
Instance Method Details
#crash(string, exception) ⇒ Object
Handle a crash
27 28 29 30 |
# File 'lib/creeper/out_logger.rb', line 27 def crash(string, exception) string << "\n" << format_exception(exception) error string end |
#debug(string) ⇒ Object
Send a debug message
7 8 9 |
# File 'lib/creeper/out_logger.rb', line 7 def debug(string) Creeper.out_logger.debug(string) if Creeper.out_logger end |
#error(string) ⇒ Object
Send an error message
22 23 24 |
# File 'lib/creeper/out_logger.rb', line 22 def error(string) Creeper.out_logger.error(string) if Creeper.out_logger end |
#format_exception(exception) ⇒ Object
Format an exception message
33 34 35 36 |
# File 'lib/creeper/out_logger.rb', line 33 def format_exception(exception) str = "#{exception.class}: #{exception.to_s}\n" str << exception.backtrace.join("\n") end |