1Log::Handler::Levels(3)User Contributed Perl DocumentatioLnog::Handler::Levels(3)
2
3
4

NAME

6       Log::Handler::Levels - All levels for Log::Handler.
7

DESCRIPTION

9       Base class for Log::Handler.
10
11       Just for internal usage and documentation.
12

METHODS

14   Default log level
15       debug()
16       info()
17       notice()
18       warning(), warn()
19       error(), err()
20       critical(), crit()
21       alert()
22       emergency(), emerg()
23
24   Checking for active levels
25       is_debug()
26       is_info()
27       is_notice()
28       is_warning(), is_warn()
29       is_error(), is_err()
30       is_critical(), is_crit()
31       is_alert()
32       is_emergency(), is_emerg()
33
34   Special level
35       fatal()
36           Alternative for the levels "critical" - "emergency".
37
38       is_fatal()
39           Check if one of the levels "critical" - "emergency" is active.
40
41   Special methods
42       trace()
43           This method is very useful if you want to add a full backtrace to
44           your message. Maybe you want to intercept unexpected errors and
45           want to know who called "die()".
46
47               $SIG{__DIE__} = sub { $log->trace(emergency => @_) };
48
49           By default the backtrace is logged as level "debug".
50
51               # would log with the level debug
52               $log->trace('who called who');
53
54           If you want to log with another level then you can pass the level
55           as first argument:
56
57               $log->trace(info => $message);
58
59       dump()
60           If you want to dump something then you can use "dump()".  The
61           default level is "debug".
62
63               my %hash = (foo => 1, bar => 2);
64
65               $log->dump(\%hash);
66
67           If you want to log with another level then you can pass the level
68           as first argument:
69
70               $log->dump($level => \%hash);
71
72       die()
73           This method logs the message to the output and then call
74           "Carp::croak()" with the level "emergency" by default.
75
76               $log->die('an emergency error here');
77
78           If you want to log with another level, then you can pass the level
79           as first argument:
80
81               $log->die(fatal => 'an emergency error here');
82
83       log()
84           With this method it's possible to log messages with the log level
85           as first argument:
86
87               $log->log(info => 'an info message');
88
89           Is the same like
90
91               $log->info('an info message');
92
93           and
94
95               $log->log('an info message');
96
97           If you log without a level then the default level is "info".
98

PREREQUISITES

100           Carp
101           Data::Dumper
102

EXPORTS

104       No exports.
105

REPORT BUGS

107       Please report all bugs to <jschulz.cpan(at)bloonix.de>.
108
109       If you send me a mail then add Log::Handler into the subject.
110

AUTHOR

112       Jonny Schulz <jschulz.cpan(at)bloonix.de>.
113
115       Copyright (C) 2007-2009 by Jonny Schulz. All rights reserved.
116
117       This program is free software; you can redistribute it and/or modify it
118       under the same terms as Perl itself.
119
120
121
122perl v5.32.0                      2020-07-28           Log::Handler::Levels(3)
Impressum