Agent:...llback(3pm)

πŸ“¦
version 1.005 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Log::Agent::Tag::Callback β€” a dynamic tag string, bestie. it's giving custom, on-the-fly tag realness ✨

so this is the perl v5.36.0 manpage, dated 2022-10-15, from the Agent:...llback(3pm) family of docs πŸŽ€


✨ SYNOPSIS ✨

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 => " -- ",
);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: this class is a tag string that's dynamic β€” its whole value comes from calling a callback you set up ahead of time. and that callback is described by a Callback object. no cap, that's the entire vibe πŸ’…

here's the tea though: if you're gonna use this tagging feature, you need to make your application depend on the Callback module from CPAN. Log::Agent does not depend on it β€” and that's on purpose, fr fr (it doesn't actually use it, it just gives you an interface to plug it in). and you gotta use at least version 1.02, periodt.


🌸 CREATION ROUTINE PARAMETERS 🌸

these are all the params, listed in alphabetical order (yes bestie, alphabetical, we love a tidy queen πŸ‘‘):

  • -callback => Callback object β€” the callback that gets invoked to determine the tag's value. the call is protected by a busy flag, just in case there's some unwanted recursion from calling one of the logging routines while you're inside the callback. and if the callback is busy, the tag it emits is:
callback "user" busy

where "user" is the name you handed over via -name for this tag πŸ‘€

  • *-name => *name β€” the name of this tag. it's what flags a callback as busy when there's an unwanted recursion back into the callback routine. so basically it's the tag's little ID badge πŸͺͺ
  • -postfix => flag β€” whether the tag goes after the log message or before it. by default it's **prepended to the log message, meaning this parameter is false. (so if you want it out back where it belongs, set this, bestie πŸ‘)
  • *-separator => *string β€” the string that separates the tag from the log message. default is a single space. πŸ’«

πŸ’œ AUTHOR πŸ’œ

Raphael Manfredi <Raphael_Manfredi@pobox.com> β€” iconic behavior, honestly 🌈


🫢 SEE ALSO 🫢

Callback(3), Log::Agent::Tag(3), Log::Agent::Message(3).


and that's a wrap, bestie πŸ’– this was Agent:...llback(3pm) from perl v5.36.0, dated 2022-10-15 β€” go forth and tag dynamically, you absolute main character 🌟

πŸ“¦ where this page comes from