Class Eymiha::EasyLogger
In: lib/eymiha/util/easylog.rb
Parent: Logger

Primarily, EasyLogger provides a convienient interface to the Logger at the class level. The class contains a "default" instance of Logger to which the class methods send their log messages. By convention, the first instance created is made the default, however this can be changed. Of course, instances may be used directly for logging if desired. Instances format their log entries using an EasyLogFormatter.

Five class-level methods are built that have the same names as the instance methods: debug, info, warn, error and fatal. Their arguments are different, however, being the message to be logged and optionally, one or more Loggers to log the message. If no Loggers are passed, the default is used, and if that is nil,no logging takes place.

Methods

Attributes

classify  [RW] 

Public Class methods

Changes the default logger to the new logger.

Sets the default logger to nil, indicating that further class level logging through the default logger mechanism is disabled.

Creates a new EasyLogger instance. Logging is recorded through the given logdev, either an IO stream or to a file when logdev is a String containing its filename. Shift age is either the number of log files to keep, or the frequency of rotation. Shift size is the maximum logfile size, applicable when shift age is a number. Subsecond precision is the number of decimal places that express fractional seconds. If this is the first instance being created, it is remembered and used by the logging methods at the class level as the default logger.

[Validate]