Handle a crash
# File lib/celluloid/logger.rb, line 57 def crash(string, exception) string << "\n" << format_exception(exception) error string @exception_handlers.each do |handler| begin handler.call(exception) rescue => ex error "EXCEPTION HANDLER CRASHED:\n" << format_exception(ex) end end end
Send a debug message
# File lib/celluloid/logger.rb, line 37 def debug(string) Celluloid.logger.debug(string) if Celluloid.logger end
Note a deprecation
# File lib/celluloid/logger.rb, line 71 def deprecate(message) trace = caller.join("\n\t") warn "DEPRECATION WARNING: #{message}\n\t#{trace}" end
Send an error message
# File lib/celluloid/logger.rb, line 52 def error(string) Celluloid.logger.error(string) if Celluloid.logger end
Define an exception handler NOTE: These should be defined at application start time
# File lib/celluloid/logger.rb, line 78 def exception_handler(&block) @exception_handlers << block nil end
Format an exception message
# File lib/celluloid/logger.rb, line 84 def format_exception(exception) str = "#{exception.class}: #{exception.to_s}\n\t" if exception.backtrace str << exception.backtrace.join("\n\t") else str << "EMPTY BACKTRACE\n\t" end end
Send a info message
# File lib/celluloid/logger.rb, line 42 def info(string) Celluloid.logger.info(string) if Celluloid.logger end
Generated with the Darkfish Rdoc Generator 2.