1Log::Dispatch::Screen(3U)ser Contributed Perl DocumentatiLoong::Dispatch::Screen(3)
2
3
4
6 Log::Dispatch::Screen - Object for logging to the screen
7
9 use Log::Dispatch::Screen;
10
11 my $screen = Log::Dispatch::Screen->new( name => 'screen',
12 min_level => 'debug',
13 stderr => 1 );
14
15 $screen->log( level => 'alert', message => "I'm searching the city for sci-fi wasabi\n" );
16
18 This module provides an object for logging to the screen (really STDOUT
19 or STDERR).
20
22 * new(%p)
23 This method takes a hash of parameters. The following options are
24 valid:
25
26 * name ($)
27 The name of the object (not the filename!). Required.
28
29 * min_level ($)
30 The minimum logging level this object will accept. See the
31 Log::Dispatch documentation on Log Levels for more informa‐
32 tion. Required.
33
34 * max_level ($)
35 The maximum logging level this obejct will accept. See the
36 Log::Dispatch documentation on Log Levels for more informa‐
37 tion. This is not required. By default the maximum is the
38 highest possible level (which means functionally that the
39 object has no maximum).
40
41 * stderr (0 or 1)
42 Indicates whether or not logging information should go to
43 STDERR. If false, logging information is printed to STDOUT
44 instead. This defaults to true.
45
46 * callbacks( \& or [ \&, \&, ... ] )
47 This parameter may be a single subroutine reference or an
48 array reference of subroutine references. These callbacks
49 will be called in the order they are given and passed a
50 hash containing the following keys:
51
52 ( message => $log_message, level => $log_level )
53
54 The callbacks are expected to modify the message and then
55 return a single scalar containing that modified message.
56 These callbacks will be called when either the "log" or
57 "log_to" methods are called and will only be applied to a
58 given message once.
59
60 * log_message( message => $ )
61 Sends a message to the appropriate output. Generally this
62 shouldn't be called directly but should be called through the
63 "log()" method (in Log::Dispatch::Output).
64
66 Dave Rolsky, <autarch@urth.org>
67
68
69
70perl v5.8.8 2006-12-20 Log::Dispatch::Screen(3)