Extended maintenance of Ruby versions 1.8.7 and 1.9.2 ended on July 31, 2014. Read more

In Files

  • webrick/log.rb
  • webrick/server.rb

Methods

Class/Module Index [+]

Quicksearch

WEBrick::Log

Attributes

time_format[RW]

Public Class Methods

new(log_file=nil, level=nil) click to toggle source
 
               # File webrick/log.rb, line 77
def initialize(log_file=nil, level=nil)
  super(log_file, level)
  @time_format = "[%Y-%m-%d %H:%M:%S]"
end
            

Public Instance Methods

log(level, data) click to toggle source
 
               # File webrick/log.rb, line 82
def log(level, data)
  tmp = Time.now.strftime(@time_format)
  tmp << " " << data
  super(level, tmp)
end