.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Agent::Tag 3pm" .TH Agent::Tag 3pm "2016-09-17" "perl v5.22.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Log::Agent::Tag \- formats caller information .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& Intended to be inherited from .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class is meant to be inherited by all the classes implementing a log message tag. .PP A message tag is a little string that is either appended or prepended to all log messages. .PP For instance, and oversimplifying a bit, a tag meant to be prepended will be inserted in front of the current log message, separated by \fIseparator\fR, which defaults to a single space: .PP .Vb 3 \& +\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ \& | tag string | separator | current log message | \& +\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ .Ve .PP This operation is called \fItag insertion\fR. The whole string then becomes the \fIcurrent log message\fR, and can be the target of another tag insertion. .PP 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 \fIappend()\fR and \fIprepend()\fR operations. .SH "FEATURES" .IX Header "FEATURES" This section documents the interface provided to heirs, in case you wish to implement your own tag class. .IP "_init(\fIname\fR, \fIpostfix\fR, \fIseparator\fR)" 4 .IX Item "_init(name, postfix, separator)" Initialization routine that should be called by all heirs during creation to initialize the common attributes. .IP "postfix" 4 .IX Item "postfix" When true, the tag is meant to be appended to the log message. Otherwise, it is prepended. .IP "name" 4 .IX Item "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 \*(L"caller\*(R" and \*(L"priority\*(R" are architecturally defined to refer to \f(CW\*(C`Log::Agent::Tag::Caller\*(C'\fR and \&\f(CW\*(C`Log::Agent::Tag::Priority\*(C'\fR objects. .Sp \&\fB\s-1NOTE\s0\fR: Currently unused by any client code. .IP "separator" 4 .IX Item "separator" The sperating string inserted between the tag and the log message. It defaults to \f(CW" "\fR if not specified, i.e. left to \f(CW\*(C`undef\*(C'\fR when calling \fI_init()\fR. .IP "\fIstring()\fR" 4 .IX Item "string()" A \fBdeferred\fR routine, to be implemented by heirs. .Sp Returns the tag string only, without the separator, since its exact placement depends on the value of the \f(CW\*(C`postfix\*(C'\fR attribute. .IP "insert(\fImessage\fR)" 4 .IX Item "insert(message)" Insert this tag withing the \f(CW\*(C`Log::Agent::Message\*(C'\fR \fImessage\fR, according to the tag specifications (placement, separator). Calls \fIstring()\fR to produce the tag string. .Sp This routine is \fBfrozen\fR and should not be redefined by heirs. .SH "STANDARD TAGGING CLASSES" .IX Header "STANDARD TAGGING CLASSES" Tagging classes define via their \f(CW\*(C`string()\*(C'\fR 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 \f(CW\*(C`Log::Agent::Tag\*(C'\fR ancestor. .PP The following classes are provided by \f(CW\*(C`Log::Agent\*(C'\fR: .ie n .IP """Log::Agent::Tag::Callback""" 4 .el .IP "\f(CWLog::Agent::Tag::Callback\fR" 4 .IX Item "Log::Agent::Tag::Callback" The \f(CW\*(C`string()\*(C'\fR routine invokes a user-supplied callback, given as a \&\f(CW\*(C`Callback\*(C'\fR object. You need the Callback module from \s-1CPAN\s0 if you wish to use this class. .ie n .IP """Log::Agent::Tag::Caller""" 4 .el .IP "\f(CWLog::Agent::Tag::Caller\fR" 4 .IX Item "Log::Agent::Tag::Caller" Used internally to compute the caller and format it according to user specifications. .ie n .IP """Log::Agent::Tag::Priority""" 4 .el .IP "\f(CWLog::Agent::Tag::Priority\fR" 4 .IX Item "Log::Agent::Tag::Priority" Used internally to format message priorities and add them to the log messages. .ie n .IP """Log::Agent::Tag::String""" 4 .el .IP "\f(CWLog::Agent::Tag::String\fR" 4 .IX Item "Log::Agent::Tag::String" Defines a constant tagging string that should be added in all the log messages, e.g. a web session \s-1ID.\s0 .SH "AUTHOR" .IX Header "AUTHOR" Raphael Manfredi \fI\fR .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fILog::Agent::Message\fR\|(3).