|
NAMELog::Message::Handlers - Message handlers for Log::MessageSYNOPSIS# Implicitly used by Log::Message to serve as handlers for # Log::Message::Item objects # Create your own file with a package called # Log::Message::Handlers to add to the existing ones, or to even # overwrite them $item->carp; $item->trace; DESCRIPTIONLog::Message::Handlers provides handlers for Log::Message::Item objects. The handler corresponding to the level (see Log::Message::Item manpage for an explanation about levels) will be called automatically upon storing the error.Handlers may also explicitly be called on an Log::Message::Item object if one so desires (see the Log::Message manpage on how to retrieve the Item objects). Default HandlerslogWill simply log the error on the stack, and do nothing specialcarpWill carp (see the Carp manpage) with the error, and add the timestamp of when it occurred.croakWill croak (see the Carp manpage) with the error, and add the timestamp of when it occurred.cluckWill cluck (see the Carp manpage) with the error, and add the timestamp of when it occurred.confessWill confess (see the Carp manpage) with the error, and add the timestamp of when it occurreddieWill simply die with the error message of the itemwarnWill simply warn with the error message of the itemtraceWill provide a traceback of this error item back to the first one that occurred, clucking with every item as it comes across it.Custom HandlersIf you wish to provide your own handlers, you can simply do the following:
And that is it, the handler will now be available to handle messages for you. The arguments a handler may receive are those specified by the "extra" key, when storing the message. See the Log::Message manpage for details on the arguments. SEE ALSOLog::Message, Log::Message::Item, Log::Message::ConfigAUTHORThis module by Jos Boumans <kane@cpan.org>.AcknowledgementsThanks to Ann Barcomb for her suggestions.COPYRIGHTThis module is copyright (c) 2002 Jos Boumans <kane@cpan.org>. All rights reserved.This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |