Wombat::Logger::LoggerBase - logger base class
package My::Logger; use base qw(Wombat::Logger::LoggerBase);
Convenience base class for logger implementations. The only method that must be implemented is write(), plus any accessor methods required for configuration, and start() and stop() if resources must be initialized and cleaned up.
write()
start()
stop()
Construct and return a Wombat::Logger::LoggerBase instance, initializing fields appropriately. If subclasses override the constructor, they must be sure to call
$self->SUPER::new();
Return the Container with which this Logger is associated.
Set the Container with which this Logger is associated.
Parameters:
the Container with which this Logger is associated
Return the verbosity level of this Logger.
Set the verbosity level of this Logger. Messages logged with a higher verbosity than this will be silently ignored.
Allowable values in increasing order are:
The default level is 'ERROR'.
the verbosity level, as a string
Throws:
if the specified log level is not one of the allowed values
Send a message and/or an exception to the log destination. If a level is specified, the Logger must be set to a verbosity level greater than or equal to the specified level. If a level is not specified, the message and/or exception will be logged unconditionally.
an optional string message to log
an optional exception to log in stack trace form
an optional log level
Write the specified string to the log destination. The default implementation does nothing. Subclasses must override this method.
the string to write to the log destination
Prepare for the beginning of active use of this Logger. This method must be called before any of the public methods of the component are utilized. Subclasses should initialize logging resources with this method.
if the Logger cannot be started
Gracefully terminate the active use of this Logger. This method must be the last called on a given instance of this component. Subclasses should release logging resources with this method.
if the Logger cannot be stopped
Servlet::Util::Exception, Wombat::Exception
Brian Moseley, bcm@maz.org
To install Wombat, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wombat
CPAN shell
perl -MCPAN -e shell install Wombat
For more information on module installation, please visit the detailed CPAN module installation guide.