1Log::Dispatch::Null(3)User Contributed Perl DocumentationLog::Dispatch::Null(3)
2
3
4
6 Log::Dispatch::File - Object that accepts messages and does nothing
7
9 use Log::Dispatch::Null;
10
11 my $null = Log::Dispatch::Null->new( name => 'null',
12 min_level => 'info' );
13
14 $null->log( level => 'emerg', message => "I've fallen and I can't get up\n" );
15
17 This class provides a null logging object. Messages can be sent to the
18 object but it does nothing with them.
19
21 * new(%p)
22 This method takes a hash of parameters. The following options are
23 valid:
24
25 * name ($)
26 The name of the object (not the filename!). Required.
27
28 * min_level ($)
29 The minimum logging level this object will accept. See the
30 Log::Dispatch documentation on Log Levels for more informa‐
31 tion. Required.
32
33 * max_level ($)
34 The maximum logging level this obejct will accept. See the
35 Log::Dispatch documentation on Log Levels for more informa‐
36 tion. This is not required. By default the maximum is the
37 highest possible level (which means functionally that the
38 object has no maximum).
39
40 * callbacks( \& or [ \&, \&, ... ] )
41 This parameter may be a single subroutine reference or an
42 array reference of subroutine references. These callbacks
43 will be called in the order they are given and passed a
44 hash containing the following keys:
45
46 ( message => $log_message, level => $log_level )
47
48 The callbacks are expected to modify the message and then
49 return a single scalar containing that modified message.
50 These callbacks will be called when either the "log" or
51 "log_to" methods are called and will only be applied to a
52 given message once.
53
54 * log_message( message => $ )
55 Sends a message to the appropriate output. Generally this
56 shouldn't be called directly but should be called through the
57 "log()" method (in Log::Dispatch::Output).
58
60 Dave Rolsky, <autarch@urth.org>
61
62
63
64perl v5.8.8 2006-12-20 Log::Dispatch::Null(3)