1Log::Dispatch::Handle(3U)ser Contributed Perl DocumentatiLoong::Dispatch::Handle(3)
2
3
4
6 Log::Dispatch::Handle - Object for logging to IO::Handle objects (and
7 subclasses thereof)
8
10 use Log::Dispatch::Handle;
11
12 my $handle = Log::Dispatch::Handle->new( name => 'a handle',
13 min_level => 'emerg',
14 handle => $io_socket_object );
15
16 $handle->log( level => 'emerg', message => 'I am the Lizard King!' );
17
19 This module supplies a very simple object for logging to some sort of
20 handle object. Basically, anything that implements a "print()" method
21 can be passed the object constructor and it should work.
22
24 * new(%p)
25 This method takes a hash of parameters. The following options are
26 valid:
27
28 * name ($)
29 The name of the object (not the filename!). Required.
30
31 * min_level ($)
32 The minimum logging level this object will accept. See the
33 Log::Dispatch documentation on Log Levels for more informa‐
34 tion. Required.
35
36 * max_level ($)
37 The maximum logging level this obejct will accept. See the
38 Log::Dispatch documentation on Log Levels for more informa‐
39 tion. This is not required. By default the maximum is the
40 highest possible level (which means functionally that the
41 object has no maximum).
42
43 * handle ($)
44 The handle object. This object must implement a "print()"
45 method.
46
47 * callbacks( \& or [ \&, \&, ... ] )
48 This parameter may be a single subroutine reference or an
49 array reference of subroutine references. These callbacks
50 will be called in the order they are given and passed a
51 hash containing the following keys:
52
53 ( message => $log_message, level => $log_level )
54
55 The callbacks are expected to modify the message and then
56 return a single scalar containing that modified message.
57 These callbacks will be called when either the "log" or
58 "log_to" methods are called and will only be applied to a
59 given message once.
60
61 * log_message( message => $ )
62 Sends a message to the appropriate output. Generally this
63 shouldn't be called directly but should be called through the
64 "log()" method (in Log::Dispatch::Output).
65
67 Dave Rolsky, <autarch@urth.org>
68
69
70
71perl v5.8.8 2006-12-20 Log::Dispatch::Handle(3)