12 Apr 2021 00:08:29 UTC
- Distribution: Log-Agent
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (166 / 0 / 0)
- KwaliteeBus factor: 1
- License: artistic_2
- Activity24 month
- Download (56.02KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:1 non-PAUSE userMROGASKI Mark Rogaski
Log::Agent::Tag::Callback - a dynamic tag string
require Log::Agent::Tag::Callback; # Inherits from Log::Agent::Tag. my $tag = Log::Agent::Tag::Callback->make( -name => "session id", -callback => Callback->new($obj, 'method', @args), -postfix => 1, -separator => " -- ", );
This class represents a dynamic tag string, whose value is determined by invoking a pre-determined callback, which is described by a
You need to make your application depend on the
Callbackmodule from CPAN if you make use of this tagging feature, since
Log::Agentdoes not depend on it, on purpose (it does not really use it, it only offers an interface to plug it in). At least version 1.02 must be used.
The following parameters are defined, in alphabetical order:
The callback to invoke to determine the value of the tag. The call is protected via a busy flag, in case there is an unwanted recursion due to a call to one of the logging routines whilst within the callback.
If the callback is busy, the tag emitted is:
callback "user" busy
useris the name you supplied via
-namefor this tag.
The name of this tag. Used to flag a callback as busy in case there is an unwanted recursion into the callback routine.
Whether tag should be placed after or before the log message. By default, it is prepended to the log message, i.e. this parameter is false.
The separation string between the tag and the log message. A single space by default.
Raphael Manfredi <Raphael_Manfredi@pobox.com>
Callback(3), Log::Agent::Tag(3), Log::Agent::Message(3).