mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/webrick: Add Documentation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7e3ec1db0d
commit
071a678a15
12 changed files with 591 additions and 18 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue