1Log::Dispatch::Perl(3)User Contributed Perl DocumentationLog::Dispatch::Perl(3)
2
3
4
6 Log::Dispatch::Perl - Use core Perl functions for logging
7
9 use Log::Dispatch::Perl ();
10
11 my $dispatcher = Log::Dispatch->new;
12 $dispatcher->add( Log::Dispatch::Perl->new(
13 name => 'foo',
14 min_level => 'info',
15 action => { debug => '',
16 info => '',
17 notice => 'warn',
18 warning => 'warn',
19 error => 'die',
20 critical => 'die',
21 alert => 'croak',
22 emergency => 'croak',
23 },
24 ) );
25
26 $dispatcher->warning( "This is a warning" );
27
29 The "Log::Dispatch::Perl" module offers a logging alternative using
30 standard Perl core functions. It allows you to fall back to the common
31 Perl alternatives for logging, such as "warn" and "cluck". It also
32 adds the possibility for a logging action to halt the current
33 environment, such as with "die" and "croak".
34
36 The following actions are currently supported (in alphabetical order):
37
38 (absent or empty string or undef)
39 Indicates no action should be executed. Default for log levels "debug"
40 and "info".
41
42 carp
43 Indicates a "carp" action should be executed. See "carp" in Carp.
44 Halts execution.
45
46 cluck
47 Indicates a "cluck" action should be executed. See "cluck" in Carp.
48 Does not halt execution.
49
50 confess
51 Indicates a "confess" action should be executed. See "confess" in
52 Carp. Does not halt execution.
53
54 croak
55 Indicates a "croak" action should be executed. See "croak" in Carp.
56 Halts execution.
57
58 die
59 Indicates a "die" action should be executed. See "die" in perlfunc.
60 Halts execution.
61
62 warn
63 Indicates a "warn" action should be executed. See "warn" in perlfunc.
64 Does not halt execution.
65
67 Log::Dispatch (1.16)
68
70 Elizabeth Mattijsen, <liz@dijkmat.nl>.
71
72 Please report bugs to <perlbugs@dijkmat.nl>.
73
75 Copyright (c) 2004 Elizabeth Mattijsen <liz@dijkmat.nl>. All rights
76 reserved. This program is free software; you can redistribute it
77 and/or modify it under the same terms as Perl itself.
78
79
80
81perl v5.12.0 2004-02-01 Log::Dispatch::Perl(3)