Use core perl functions for logging
use Log::Dispatch::Perl ();
my $dispatcher = Log::Dispatch->new;
$dispatcher->add( Log::Dispatch::Perl->new(
name => 'foo',
min_level => 'info',
action => { debug => '',
info => '',
notice => 'warn',
warning => 'warn',
error => 'die',
critical => 'die',
alert => 'croak',
emergency => 'croak',
},
) );
$dispatcher->warning( "This is a warning" );
This documentation describes version 0.04.
The \*(L"Log::Dispatch::Perl\*(R" module offers a logging alternative using standard Perl core functions. It allows you to fall back to the common Perl alternatives for logging, such as \*(L"warn\*(R" and \*(L"cluck\*(R". It also adds the possibility for a logging action to halt the current environment, such as with \*(L"die\*(R" and \*(L"croak\*(R".
The following actions are currently supported (in alphabetical order):
Indicates no action should be executed. Default for log levels \*(L"debug\*(R" and \*(L"info\*(R".
Indicates a \*(L"carp\*(R" action should be executed. See \*(L"carp\*(R" in Carp. Halts execution.
Indicates a \*(L"cluck\*(R" action should be executed. See \*(L"cluck\*(R" in Carp. Does not halt execution.
Indicates a \*(L"confess\*(R" action should be executed. See \*(L"confess\*(R" in Carp. Halts execution.
Indicates a \*(L"croak\*(R" action should be executed. See \*(L"croak\*(R" in Carp. Halts execution.
Indicates a \*(L"die\*(R" action should be executed. See \*(L"die\*(R" in perlfunc. Halts execution.
Indicates a \*(L"warn\*(R" action should be executed. See \*(L"warn\*(R" in perlfunc. Does not halt execution.
Log::Dispatch (1.16)
Elizabeth Mattijsen, <[email protected]>.
Please report bugs to <[email protected]>.
Copyright (c) 2004, 2012 Elizabeth Mattijsen <[email protected]>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.