Module: Thin::Logging

Module Thin::Logging < Object

(in files lib/thin/logging.rb )

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+.

Includes

  • ERB::Util

Methods

Public Class debug?()

    # File lib/thin/logging.rb, line 14
14:       def debug?;  !@silent && @debug  end

Public Class silent?()

    # File lib/thin/logging.rb, line 15
15:       def silent?;  @silent            end

Public Class trace?()

    # File lib/thin/logging.rb, line 13
13:       def trace?;  !@silent && @trace  end

Public Instance debug(msg=nil) {|if Logging.debug?| ...}

Log a message to the console if debugging is activated

    # File lib/thin/logging.rb, line 41
41:     def debug(msg=nil)
42:       log msg || yield if Logging.debug?
43:     end

Public Instance log(msg)

Log a message to the console

    # File lib/thin/logging.rb, line 27
27:     def log(msg)
28:       puts msg unless Logging.silent?
29:     end

Public Instance log_error(e=$!)

Log an error backtrace if debugging is activated

    # File lib/thin/logging.rb, line 48
48:     def log_error(e=$!)
49:       debug "#{e}\n\t" + e.backtrace.join("\n\t")
50:     end

Public Instance silent()

Global silencer methods

    # File lib/thin/logging.rb, line 19
19:     def silent
20:       Logging.silent?
21:     end

Public Instance silent=(value)

    # File lib/thin/logging.rb, line 22
22:     def silent=(value)
23:       Logging.silent = value
24:     end

Public Instance trace(msg=nil) {|if Logging.trace?| ...}

Log a message to the console if tracing is activated

    # File lib/thin/logging.rb, line 34
34:     def trace(msg=nil)
35:       log msg || yield if Logging.trace?
36:     end