1Agent::Tag::Caller(3) User Contributed Perl DocumentationAgent::Tag::Caller(3)
2
3
4
6 Log::Agent::Tag::Caller - formats caller information
7
9 Not intended to be used directly
10 Inherits from Log::Agent::Tag.
11
13 This class handles caller information for Log::Agent services and is
14 not meant to be used directly.
15
16 This manpage therefore only documents the creation routine parameters
17 that can be specified at the Log::Agent level via the "-caller" switch
18 in the logconfig() routine.
19
21 This class knows about four entities: package, filename, line and
22 subroutine, which are to be understood within the context of the
23 Log::Agent routine being called (e.g. a logwarn() routine), namely:
24
25 package
26 This is the package name where the call to the logwarn() routine
27 was made. It can be specified as "pack" for short, or spelled out
28 completely.
29
30 filename
31 This is the file where the call to the logwarn() routine was made.
32 It can be specified as "file" for short, or spelled out completely.
33
34 line
35 This is the line number where the call to the logwarn() routine was
36 made, in file filename. The name is short enough to be spelled out
37 completely.
38
39 subroutine
40 This is the subroutine where the call to the logwarn() routine was
41 made. If the call is made outside a subroutine, this will be
42 empty. The name is long enough to warrant the "sub" abbreviation
43 if you don't wish to spell it out fully.
44
46 The purpose of those parameters is to define how caller information
47 entities (as defined by the previous section) will be formatted within
48 the log message.
49
50 "-display" => string
51 Specifies a string with minimal variable substitution: only the
52 caller information entities specified above, or their abbreviation,
53 will be interpolated. For instance:
54
55 -display => '($package::$sub/$line)'
56
57 Don't forget to use simple quotes to avoid having Perl interpolate
58 those as variables, or escape their leading "$" sign otherwise.
59 Using this convention was deemed to more readable (and natural in
60 Perl) than SGML entities such as "&pack;".
61
62 Using this switch supersedes the "-info" and "-format" switches.
63
64 "-format" => printf format
65 Formatting instructions for the caller information entities listed
66 by the "-info" switch. For instance:
67
68 -format => "%s:%4d"
69
70 if you have specified two entities in "-info".
71
72 The special formatting macro %a stands for all the entities
73 specified by "-info" and is rendered by a string where values are
74 separated by ":".
75
76 "-info" => "space separated list of parameters"
77 Specifies a list of caller information entities that are to be
78 formated using the "-format" specification. For instance:
79
80 -info => "pack sub line"
81
82 would only report those three entites.
83
84 "-postfix" => flag
85 Whether the string resulting from the formatting of the caller
86 information entities should be appended to the regular log message
87 or not (i.e. prepended, which is the default).
88
89 "-separator" => string
90 The separation string between the tag and the log message. A
91 single space by default.
92
94 Raphael Manfredi <Raphael_Manfredi@pobox.com> created the module, it is
95 currently maintained by Mark Rogaski <mrogaski@cpan.org>.
96
97 Thanks to Jeff Boes for uncovering wackiness in caller().
98
100 Copyright (C) 1999 Raphael Manfredi. Copyright (C) 2002 Mark Rogaski;
101 all rights reserved.
102
103 See Log::Agent(3) or the README file included with the distribution for
104 license information.
105
107 Log::Agent(3), Log::Agent::Message(3).
108
109
110
111perl v5.34.0 2021-07-22 Agent::Tag::Caller(3)