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 version 0.05
10
12 use Log::Dispatch::Perl ();
13
14 my $dispatcher = Log::Dispatch->new;
15 $dispatcher->add( Log::Dispatch::Perl->new(
16 name => 'foo',
17 min_level => 'info',
18 action => { debug => '',
19 info => '',
20 notice => 'warn',
21 warning => 'warn',
22 error => 'die',
23 critical => 'die',
24 alert => 'croak',
25 emergency => 'croak',
26 },
27 ) );
28
29 $dispatcher->warning( "This is a warning" );
30
32 The "Log::Dispatch::Perl" module offers a logging alternative using
33 standard Perl core functions. It allows you to fall back to the common
34 Perl alternatives for logging, such as "warn" and "cluck". It also
35 adds the possibility for a logging action to halt the current
36 environment, such as with "die" and "croak".
37
39 The following actions are currently supported (in alphabetical order):
40
41 (absent or empty string or undef)
42 Indicates no action should be executed. Default for log levels "debug"
43 and "info".
44
45 carp
46 Indicates a "carp" action should be executed. See "carp" in Carp.
47 Halts execution.
48
49 cluck
50 Indicates a "cluck" action should be executed. See "cluck" in Carp.
51 Does not halt execution.
52
53 confess
54 Indicates a "confess" action should be executed. See "confess" in
55 Carp. Halts execution.
56
57 croak
58 Indicates a "croak" action should be executed. See "croak" in Carp.
59 Halts execution.
60
61 die
62 Indicates a "die" action should be executed. See "die" in perlfunc.
63 Halts execution.
64
65 warn
66 Indicates a "warn" action should be executed. See "warn" in perlfunc.
67 Does not halt execution.
68
70 Bugs may be submitted through the RT bug tracker
71 <https://rt.cpan.org/Public/Dist/Display.html?Name=Log-Dispatch-Perl>
72 (or bug-Log-Dispatch-Perl@rt.cpan.org <mailto:bug-Log-Dispatch-
73 Perl@rt.cpan.org>).
74
75 I am also usually active on irc, as 'ether' at "irc.perl.org" and
76 "irc.freenode.org".
77
79 Elizabeth Mattijsen (liz@dijkmat.nl)
80
82 Karen Etheridge <ether@cpan.org>
83
85 This software is copyright (c) 2020 by Elizabeth Mattijsen.
86
87 This is free software; you can redistribute it and/or modify it under
88 the same terms as the Perl 5 programming language system itself.
89
90
91
92perl v5.32.0 2020-07-28 Log::Dispatch::Perl(3)