Log::Agent::Tag::Caller - formats caller information |
Log::Agent::Tag::Caller - formats caller information
Not intended to be used directly Inherits from Log::Agent::Tag.
This class handles caller information for Log::Agent services and is not meant to be used directly.
This manpage therefore only documents the creation routine parameters
that can be specified at the Log::Agent level via the -caller
switch
in the logconfig()
routine.
This class knows about four entities: package, filename, line
and subroutine, which are to be understood within the context of the
Log::Agent routine being called (e.g. a logwarn()
routine), namely:
logwarn()
routine was made.
It can be specified as ``pack'' for short, or spelled out completely.
logwarn()
routine was made.
It can be specified as ``file'' for short, or spelled out completely.
logwarn()
routine was made,
in file filename. The name is short enough to be spelled out completely.
logwarn()
routine was made.
If the call is made outside a subroutine, this will be empty.
The name is long enough to warrant the ``sub'' abbreviation if you don't wish
to spell it out fully.
The purpose of those parameters is to define how caller information entities (as defined by the previous section) will be formatted within the log message.
-display
=> string-display => '($package::$sub/$line)'
Don't forget to use simple quotes to avoid having Perl interpolate those
as variables, or escape their leading $
sign otherwise. Using this
convention was deemed to more readable (and natural in Perl)
than SGML entities such as ``&pack;''.
Using this switch supersedes the -info
and -format
switches.
-format
=> printf format-info
switch. For instance:
-format => "%s:%4d"
if you have specified two entities in -info
.
The special formatting macro %a
stands for all the entities specified
by -info
and is rendered by a string where values are separated by ``:''.
-info
=> ``space separated list of parameters''-format
specification. For instance:
-info => "pack sub line"
would only report those three entites.
-postfix
=> flag-separator
=> string
Raphael Manfredi <Raphael_Manfredi@pobox.com> created the module, it is currently maintained by Mark Rogaski <mrogaski@cpan.org>.
Thanks to Jeff Boes for uncovering wackiness in caller().
Copyright (C) 1999 Raphael Manfredi. Copyright (C) 2002 Mark Rogaski; all rights reserved.
See the Log::Agent(3) manpage or the README file included with the distribution for license information.
Log::Agent(3), Log::Agent::Message(3).
Log::Agent::Tag::Caller - formats caller information |