Agent::Tag(3pm) | User Contributed Perl Documentation | Agent::Tag(3pm) |
Log::Agent::Tag - formats caller information
Intended to be inherited from
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.
This section documents the interface provided to heirs, in case you wish to implement your own tag class.
NOTE: Currently unused by any client code.
Returns the tag string only, without the separator, since its exact placement depends on the value of the "postfix" attribute.
This routine is frozen and should not be redefined by heirs.
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":
Raphael Manfredi <Raphael_Manfredi@pobox.com>
2022-10-15 | perl v5.34.0 |