To be included in classes to allow some basic logging that can be silenced (Logging.silent=) or made more verbose. Logging.debug=: log all error backtrace and messages
logged with +debug+.
Logging.trace=: log all raw request and response and
messages logged with +trace+.
Log a message to the console if debugging is activated
# File lib/thin/logging.rb, line 41 def debug(msg=nil) log msg || yield if Logging.debug? end
# File lib/thin/logging.rb, line 14 def debug?; !@silent && @debug end
Log a message to the console
# File lib/thin/logging.rb, line 27 def log(msg) puts msg unless Logging.silent? end
Log an error backtrace if debugging is activated
# File lib/thin/logging.rb, line 48 def log_error(e=$!) debug "#{e}\n\t" + e.backtrace.join("\n\t") end
Log a message to the console if debugging is activated
# File lib/thin/logging.rb, line 41 def debug(msg=nil) log msg || yield if Logging.debug? end
Log a message to the console
# File lib/thin/logging.rb, line 27 def log(msg) puts msg unless Logging.silent? end
Log an error backtrace if debugging is activated
# File lib/thin/logging.rb, line 48 def log_error(e=$!) debug "#{e}\n\t" + e.backtrace.join("\n\t") end
Global silencer methods
# File lib/thin/logging.rb, line 19 def silent Logging.silent? end
Generated with the Darkfish Rdoc Generator 2.