Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

log::agent::tag(3pm) [debian man page]

Agent::Tag(3pm) 					User Contributed Perl Documentation					   Agent::Tag(3pm)

NAME
Log::Agent::Tag - formats caller information SYNOPSIS
Intended to be inherited from DESCRIPTION
This class is meant to be inherited by all the classes implementing a log message tag. A message tag is a little string that is either appended or prepended to all log messages. For instance, and oversimplifying a bit, a tag meant to be prepended will be inserted in front of the current log message, separated by separator, which defaults to a single space: +------------+-----------+---------------------------------+ | tag string | separator | current log message | +------------+-----------+---------------------------------+ This operation is called tag insertion. The whole string then becomes the current log message, and can be the target of another tag insertion. The reality is a little bit more complex, to allow successive tags to be prepended or appended in the order they are specified, and not in reverse order as they would be if naively implemented. See Log::Agent::Message for the exact semantics of append() and prepend() operations. FEATURES
This section documents the interface provided to heirs, in case you wish to implement your own tag class. _init(name, postfix, separator) Initialization routine that should be called by all heirs during creation to initialize the common attributes. postfix When true, the tag is meant to be appended to the log message. Otherwise, it is prepended. name The name of this tag. It is meant to provide by-name access to tags, check whether a given tag is recorded, etc... The names "caller" and "priority" are architecturally defined to refer to "Log::Agent::Tag::Caller" and "Log::Agent::Tag::Priority" objects. NOTE: Currently unused by any client code. separator The sperating string inserted between the tag and the log message. It defaults to " " if not specified, i.e. left to "undef" when calling _init(). string() A deferred routine, to be implemented by heirs. Returns the tag string only, without the separator, since its exact placement depends on the value of the "postfix" attribute. insert(message) Insert this tag withing the "Log::Agent::Message" message, according to the tag specifications (placement, separator). Calls string() to produce the tag string. This routine is frozen and should not be redefined by heirs. STANDARD TAGGING CLASSES
Tagging classes define via their "string()" routine what is the string to be used as a tag. The insertion of the tag within the log message is done via a frozen routine from the "Log::Agent::Tag" ancestor. The following classes are provided by "Log::Agent": "Log::Agent::Tag::Callback" The "string()" routine invokes a user-supplied callback, given as a "Callback" object. You need the Callback module from CPAN if you wish to use this class. "Log::Agent::Tag::Caller" Used internally to compute the caller and format it according to user specifications. "Log::Agent::Tag::Priority" Used internally to format message priorities and add them to the log messages. "Log::Agent::Tag::String" Defines a constant tagging string that should be added in all the log messages, e.g. a web session ID. AUTHOR
Raphael Manfredi <Raphael_Manfredi@pobox.com> SEE ALSO
Log::Agent::Message(3). perl v5.10.0 2002-03-09 Agent::Tag(3pm)

Check Out this Related Man Page

Agent::Tag::Caller(3pm) 				User Contributed Perl Documentation				   Agent::Tag::Caller(3pm)

NAME
Log::Agent::Tag::Caller - formats caller information SYNOPSIS
Not intended to be used directly Inherits from Log::Agent::Tag. DESCRIPTION
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. CALLER INFORMATION ENTITIES
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: package This is the package name where the call to the logwarn() routine was made. It can be specified as "pack" for short, or spelled out completely. filename This is the file where the call to the logwarn() routine was made. It can be specified as "file" for short, or spelled out completely. line This is the line number where the call to the logwarn() routine was made, in file filename. The name is short enough to be spelled out completely. subroutine This is the subroutine where the call to the 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. CREATION ROUTINE PARAMETERS
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 Specifies a string with minimal variable substitution: only the caller information entities specified above, or their abbreviation, will be interpolated. For instance: -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 Formatting instructions for the caller information entities listed by the "-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" Specifies a list of caller information entities that are to be formated using the "-format" specification. For instance: -info => "pack sub line" would only report those three entites. "-postfix" => flag Whether the string resulting from the formatting of the caller information entities should be appended to the regular log message or not (i.e. prepended, which is the default). "-separator" => string The separation string between the tag and the log message. A single space by default. AUTHORS
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(). LICENSE
Copyright (C) 1999 Raphael Manfredi. Copyright (C) 2002 Mark Rogaski; all rights reserved. See Log::Agent(3) or the README file included with the distribution for license information. SEE ALSO
Log::Agent(3), Log::Agent::Message(3). perl v5.10.0 2002-03-09 Agent::Tag::Caller(3pm)
Man Page