diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-10 00:13:58 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-10 00:13:58 +0000 |
commit | 071a678a156dde974d8e470b659c89cb02b07b3b (patch) | |
tree | a0c846f48a5107c97261a117e7624edabe6feddd /lib/webrick/log.rb | |
parent | 7e3ec1db0da950bf77bc3aa8d9b24b161cb60654 (diff) |
* lib/webrick: Add Documentation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick/log.rb')
-rw-r--r-- | lib/webrick/log.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/webrick/log.rb b/lib/webrick/log.rb index 765599aa5b..fe253e51a2 100644 --- a/lib/webrick/log.rb +++ b/lib/webrick/log.rb @@ -9,12 +9,23 @@ # $IPR: log.rb,v 1.26 2002/10/06 17:06:10 gotoyuzo Exp $ module WEBrick + + ## + # A generic logging class + class BasicLog # log-level constant FATAL, ERROR, WARN, INFO, DEBUG = 1, 2, 3, 4, 5 attr_accessor :level + ## + # Initializes a new logger for +log_file+ that outputs messages at +level+ + # or higher. +log_file+ can be a filename, an IO-like object that + # responds to #<< or nil which outputs to $stderr. + # + # If no level is given INFO is chosen by default + def initialize(log_file=nil, level=nil) @level = level || INFO case log_file @@ -71,6 +82,9 @@ module WEBrick end end + ## + # A logging class with timestamps + class Log < BasicLog attr_accessor :time_format |