| Log-Report documentation | view source | Contained in the Log-Report distribution. |
Log::Report::Dispatcher::Callback - call a code-ref for each log-line
Log::Report::Dispatcher::Callback is a Log::Report::Dispatcher
sub cb($$$)
{ my ($options, $reason, $message) = @_;
...
}
dispatcher Log::Report::Dispatcher::Callback => 'cb'
, callback => \&cb;
dispatcher CALLBACK => 'cb' # same
, callback => \&cb;
This basic file logger accepts a callback, which is called for each message which is to be logged. When you need complex things, you may best make your own extension to Log::Report::Dispatcher, but for simple things this will do.
-Option --Defined in --Default accept Log::Report::Dispatcher depend on mode callback <required> charset Log::Report::Dispatcher <undef> format_reason Log::Report::Dispatcher 'LOWERCASE' locale Log::Report::Dispatcher <system locale> mode Log::Report::Dispatcher 'NORMAL'
Your callback is called with four parameters: this dispatcher object,
the options, a reason and a message. The options are the first
parameter of Log::Report::report() (read over there). The reason
is a capitized string like ERROR. Finally, the message is a
Log::Report::Message.
Returns the code reference which will handle each logged message.
This module is part of Log-Report distribution version 0.93, built on June 30, 2011. Website: http://perl.overmeer.net/log-report/
Copyrights 2007-2011 by Mark Overmeer. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html
| Log-Report documentation | view source | Contained in the Log-Report distribution. |