The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
=encoding utf8

=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.

See L<documentation in the base class|Log::Report::Dispatcher/"DESCRIPTION">.
 
=head1 METHODS

See L<documentation in the base class|Log::Report::Dispatcher/"METHODS">.
 
=head2 Constructors

See L<documentation in the base class|Log::Report::Dispatcher/"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

See L<documentation in the base class|Log::Report::Dispatcher/"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

See L<documentation in the base class|Log::Report::Dispatcher/"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 DETAILS

See L<documentation in the base class|Log::Report::Dispatcher/"DETAILS">.
 
=head1 SEE ALSO

This module is part of Log-Report distribution version 0.996,
built on September 04, 2013. Website: F<http://perl.overmeer.net/log-report/>

=head1 LICENSE

Copyrights 2007-2013 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>