=head1 NAME
Log::Report::Dispatcher::Callback - call a code-ref for each log-line
=head1 INHERITANCE
Log::Report::Dispatcher::Callback
is a Log::Report::Dispatcher
=head1 SYNOPSIS
sub cb($$$)
{ my ($disp, $options, $reason, $message) = @_;
...
}
dispatcher Log::Report::Dispatcher::Callback => 'cb'
, callback => \&cb;
dispatcher CALLBACK => 'cb' # same
, callback => \&cb;
=head1 DESCRIPTION
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 L<Log::Report::Dispatcher|Log::Report::Dispatcher>, but
for simple things this will do.
=head1 METHODS
=head2 Constructors
=over 4
=item $obj-E<gt>B<close>()
See L<Log::Report::Dispatcher/"Constructors">
=item Log::Report::Dispatcher::Callback-E<gt>B<new>(TYPE, NAME, OPTIONS)
-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'
=over 2
=item accept => REASONS
=item callback => CODE
Your C<callback> is called with four parameters: this dispatcher object,
the options, a reason and a message. The C<options> are the first
parameter of L<Log::Report::report()|Log::Report/"Report Production and Configuration"> (read over there). The C<reason>
is a capitized string like C<ERROR>. Finally, the C<message> is a
L<Log::Report::Message|Log::Report::Message>.
=item charset => CHARSET
=item format_reason => 'UPPERCASE'|'LOWERCASE'|'UCFIRST'|'IGNORE'|CODE
=item locale => LOCALE
=item mode => 'NORMAL'|'VERBOSE'|'ASSERT'|'DEBUG'|0..3
=back
=back
=head2 Accessors
=over 4
=item $obj-E<gt>B<callback>()
Returns the code reference which will handle each logged message.
=item $obj-E<gt>B<isDisabled>()
See L<Log::Report::Dispatcher/"Accessors">
=item $obj-E<gt>B<mode>()
See L<Log::Report::Dispatcher/"Accessors">
=item $obj-E<gt>B<name>()
See L<Log::Report::Dispatcher/"Accessors">
=item $obj-E<gt>B<needs>()
See L<Log::Report::Dispatcher/"Accessors">
=item $obj-E<gt>B<type>()
See L<Log::Report::Dispatcher/"Accessors">
=back
=head2 Logging
=over 4
=item $obj-E<gt>B<collectLocation>()
=item Log::Report::Dispatcher::Callback-E<gt>B<collectLocation>()
See L<Log::Report::Dispatcher/"Logging">
=item $obj-E<gt>B<collectStack>([MAXDEPTH])
=item Log::Report::Dispatcher::Callback-E<gt>B<collectStack>([MAXDEPTH])
See L<Log::Report::Dispatcher/"Logging">
=item $obj-E<gt>B<log>(HASH-of-OPTIONS, REASON, MESSAGE)
See L<Log::Report::Dispatcher/"Logging">
=item $obj-E<gt>B<stackTraceLine>(OPTIONS)
=item Log::Report::Dispatcher::Callback-E<gt>B<stackTraceLine>(OPTIONS)
See L<Log::Report::Dispatcher/"Logging">
=item $obj-E<gt>B<translate>(HASH-of-OPTIONS, REASON, MESSAGE)
See L<Log::Report::Dispatcher/"Logging">
=back
=head1 SEE ALSO
This module is part of Log-Report distribution version 0.99,
built on October 03, 2012. Website: F<http://perl.overmeer.net/log-report/>
=head1 LICENSE
Copyrights 2007-2012 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 F<http://www.perl.com/perl/misc/Artistic.html>