A generic logging class
- #
- C
- D
- E
- F
- I
- L
- N
- W
FATAL | = | 1 |
Fatal log level which indicates a server crash |
||
ERROR | = | 2 |
Error log level which indicates a recoverable error |
||
WARN | = | 3 |
Warning log level which indicates a possible problem |
||
INFO | = | 4 |
Information log level which indicates possibly useful information |
||
DEBUG | = | 5 |
Debugging error level for messages used in server development or debugging |
[RW] | level | log-level, messages above this level will be logged |
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
# File lib/webrick/log.rb, line 49 def initialize(log_file=nil, level=nil) @level = level || INFO case log_file when String @log = open(log_file, "a+") @log.sync = true @opened = true when NilClass @log = $stderr else @log = log_file # requires "<<". (see BasicLog#log) end end
Synonym for log(INFO, obj.to_s)
Closes the logger (also closes the log device associated to the logger)
Logs data
at level
if the given level is above
the current log level.