Module: MongrelDbg

Module | MongrelDbg
In: | lib/mongrel/debug.rb lib/mongrel/debug.rb

### Methods

begin_trace begin_trace configure configure end_trace end_trace trace trace tracing? tracing?

### Constants

SETTINGS | = | { :tracing => {}}
LOGGING | = | { }
SETTINGS | = | { :tracing => {}}
LOGGING | = | { }

### Public Class methods

begin_trace(target)

[Source]

        # File lib/mongrel/debug.rb, line 33
    33:   def MongrelDbg::begin_trace(target)
    34:     SETTINGS[:tracing][target] = true
    35:     if not LOGGING[target]
    36:       LOGGING[target] = Logger.new(File.join(@log_dir, "#{target.to_s}.log"))
    37:     end
    38:     MongrelDbg::trace(target, "TRACING ON #{Time.now}")
    39:   end

begin_trace(target)

[Source]

        # File lib/mongrel/debug.rb, line 33
    33:   def MongrelDbg::begin_trace(target)
    34:     SETTINGS[:tracing][target] = true
    35:     if not LOGGING[target]
    36:       LOGGING[target] = Logger.new(File.join(@log_dir, "#{target.to_s}.log"))
    37:     end
    38:     MongrelDbg::trace(target, "TRACING ON #{Time.now}")
    39:   end

configure(log_dir = File.join("log","mongrel_debug"))

[Source]

        # File lib/mongrel/debug.rb, line 16
    16:   def MongrelDbg::configure(log_dir = File.join("log","mongrel_debug"))
    17:     FileUtils.mkdir_p(log_dir)
    18:     @log_dir = log_dir
    19:     $objects_out=open(File.join("log","mongrel_debug","objects.log"),"w")
    20:     $objects_out.puts "run,classname,last,count,delta,lenmean,lensd,lenmax"
    21:     $objects_out.sync = true
    22:     $last_stat = nil
    23:     $run_count = 0
    24:   end

configure(log_dir = File.join("log","mongrel_debug"))

[Source]

        # File lib/mongrel/debug.rb, line 16
    16:   def MongrelDbg::configure(log_dir = File.join("log","mongrel_debug"))
    17:     FileUtils.mkdir_p(log_dir)
    18:     @log_dir = log_dir
    19:     $objects_out=open(File.join("log","mongrel_debug","objects.log"),"w")
    20:     $objects_out.puts "run,classname,last,count,delta,lenmean,lensd,lenmax"
    21:     $objects_out.sync = true
    22:     $last_stat = nil
    23:     $run_count = 0
    24:   end

end_trace(target)

[Source]

        # File lib/mongrel/debug.rb, line 41
    41:   def MongrelDbg::end_trace(target)
    42:     SETTINGS[:tracing][target] = false
    43:     MongrelDbg::trace(target, "TRACING OFF #{Time.now}")
    44:     LOGGING[target].close
    45:     LOGGING[target] = nil
    46:   end

end_trace(target)

[Source]

        # File lib/mongrel/debug.rb, line 41
    41:   def MongrelDbg::end_trace(target)
    42:     SETTINGS[:tracing][target] = false
    43:     MongrelDbg::trace(target, "TRACING OFF #{Time.now}")
    44:     LOGGING[target].close
    45:     LOGGING[target] = nil
    46:   end

trace(target, message)

[Source]

        # File lib/mongrel/debug.rb, line 27
    27:   def MongrelDbg::trace(target, message)
    28:     if SETTINGS[:tracing][target] and LOGGING[target]
    29:       LOGGING[target].log(Logger::DEBUG, message)
    30:     end
    31:   end

trace(target, message)

[Source]

        # File lib/mongrel/debug.rb, line 27
    27:   def MongrelDbg::trace(target, message)
    28:     if SETTINGS[:tracing][target] and LOGGING[target]
    29:       LOGGING[target].log(Logger::DEBUG, message)
    30:     end
    31:   end

tracing?(target)

[Source]

        # File lib/mongrel/debug.rb, line 48
    48:   def MongrelDbg::tracing?(target)
    49:     SETTINGS[:tracing][target]
    50:   end

tracing?(target)

[Source]

        # File lib/mongrel/debug.rb, line 48
    48:   def MongrelDbg::tracing?(target)
    49:     SETTINGS[:tracing][target]
    50:   end

[Validate]