WWW::Domain::Registry::Joker::Loggish - a simple logging helper
use WWW::Domain::Registry::Joker::Loggish; @ISA = qw/WWW::Domain::Registry::Joker::Loggish/; $self = WWW::Domain::Registry::Joker::Loggish::new($proto, 'debug' => 1); $self->debug('Diagnostics for the masses'); $self->error('Nobody loves me!'); $self->log('notice', 'Something important is about to happen'); $self->log('debug', 'Nobody ever bothers to read those...');
WWW::Domain::Registry::Joker::Loggish class provides a simple logging interface, implemented using the
Log::Dispatch module. It is meant to serve as a parent class providing the
error() methods so that other classes do not have to worry about implementing them.
WWW::Domain::Registry::Joker::Loggish class provides the following methods:
Create a new
WWW::Domain::Registry::Joker::Loggish object with the specified parameters:
A boolean flag for the output of diagnostic messages - should the
debug() method actually display the message passed or simply ignore it.
Log::Dispatch object to use for the output; if not passed, a new object will be created at first use - see the
logger() method below.
Get or set the
Log::Dispatch object used for the actual logging.
If no object is specified and no logging object has been set yet, this method will create a
Log::Dispatch object and a
Log::Dispatch::Screen destination set to output to the standard error stream. If tis does not suit the needs of the application, it should invoke the
logger() method and pass its own
Log::Dispatch handler. This may also be done at object creation time by passing the
log parameter to the
Log the specified message at the specified level.
This method invokes the
logger() method, so that a
Log::Dispatch object will be created automatically at first use if none has been specified.
Log a message with a priority of 'debug' using the
log() method. Note that whether the message will actually be logged or not will depend on the setting of the
debug property at object creation time.
Log a message with a priority of 'error' using the
WWW::Domain::Registry::Joker::Loggish class was written by Peter Pentchev in 2007.
Peter Pentchev, <firstname.lastname@example.org>
Copyright (C) 2007 by Peter Pentchev
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.