Agent:...efault(3pm)
π Agent:...efault(3pm) β Log::Agent::Driver::Default π
okay bestie, so this page is literally called Agent:...efault(3pm) and no, the title isn't having a stroke β it's just the truncation vibe. What you're actually looking at is Log::Agent::Driver::Default, and it's a Perl thing, so buckle up π
β¨ NAME β¨
Log::Agent::Driver::Default β the default logging driver for Log::Agent. she's the baseline, the blueprint, the moment β¨
πΈ SYNOPSIS πΈ
Two ways to do this, and honestly both are giving:
Implicit use β you just let her show up uninvited (in the best way):
# Implicit use
use Log::Agent;
logconfig(-prefix => "prefix"); # optional
Explicit use β you're a control freak and I respect it π :
# Explicit use
use Log::Agent;
require Log::Agent::Driver::Default;
my $driver = Log::Agent::Driver::Default->make("prefix");
logconfig(-driver => $driver);
π DESCRIPTION π
So the default logging driver takes all your logxxx() operations and remaps them to their default Perl counterpart. Like, it's a translator but the translation is "just use Perl, babe."
For instance: logerr() will issue a warn(), and logwarn() will call warn() with a clear "WARNING: " emphasis β because otherwise how would you ever tell the two calls apart?? π the emphasis is the whole point.
The only routine that matters here is the creation routine, so let's give her the spotlight:
make($prefix)β creates aLog::Agent::Driver::Defaultdriver whose prefix string will be$prefix. And when no prefix is configured at all? The first letter of each logged string gets uppercased. that's it. that's the whole personality π¦
π CHANNELS π
The "error", "output" and "debug" channels all go to STDERR.
all three of them. same place. STDERR gets everything, she's carrying the whole team fr fr π
π¨ BUGS π¨
okay this one's a little spicy, listen up:
If logdie() is used within an eval(), the string you will get in $@ will be prefixed.
and no, it's not really a bug, bestie β it's simply that wrapping code intoeval()and parsing$@is poor's man exception handling, and it shows its limit right here π
Because here's the thing: the programmer using logdie() cannot foresee which driver will be used, so the returned string cannot be determined precisely. You literally can't know what you're gonna get. it's giving mystery box π
Morality: use die() if you mean it, and document the string as an exception. periodt. π
π AUTHOR π
Raphael Manfredi <Raphael_Manfredi@pobox.com>
(we stan a legend π«Ά)
π SEE ALSO π
and that's the whole page!! no cap, you now know everything this manpage knows π§
perl v5.36.0 Β· 2022-10-15 Β· from the User Contributed Perl Documentation girlies, banner and all β mwah πβ¨πΈ
bye bestie, go log responsibly π
π¦ where this page comes from
- ubuntu noble: liblog-agent-perl 1.005-2 Β· Artistic-2.0
- ubuntu resolute: liblog-agent-perl 1.005-2 Β· Artistic-2.0
- ubuntu stonking: liblog-agent-perl 1.005-2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms