1Agent::Driver::Default(U3s)er Contributed Perl DocumentatAigoennt::Driver::Default(3)
2
3
4
6 Log::Agent::Driver::Default - default logging driver for Log::Agent
7
9 # Implicit use
10 use Log::Agent;
11 logconfig(-prefix => "prefix"); # optional
12
13 # Explicit use
14 use Log::Agent;
15 require Log::Agent::Driver::Default;
16
17 my $driver = Log::Agent::Driver::Default->make("prefix");
18 logconfig(-driver => $driver);
19
21 The default logging driver remaps the logxxx() operations to their
22 default Perl counterpart. For instance, logerr() will issue a warn()
23 and logwarn() will call warn() with a clear "WARNING: " emphasis (to
24 distinguish between the two calls).
25
26 The only routine of interest here is the creation routine:
27
28 make($prefix)
29 Create a Log::Agent::Driver::Default driver whose prefix string
30 will be $prefix. When no prefix is configured, the first letter of
31 each logged string will be uppercased.
32
34 The "error", "output" and "debug" channels all go to STDERR.
35
37 If logdie() is used within an eval(), the string you will get in $@
38 will be prefixed. It's not really a bug, simply that wrapping a code
39 into eval() and parsing $@ is poor's man exception handling which shows
40 its limit here: since the programmer using logdie() cannot foresee
41 which driver will be used, the returned string cannot be determined
42 precisely. Morality: use die() if you mean it, and document the string
43 as an exception.
44
46 Raphael Manfredi <Raphael_Manfredi@pobox.com>
47
49 Log::Agent::Driver(3), Log::Agent(3).
50
51
52
53perl v5.32.1 2021-02-15 Agent::Driver::Default(3)