Log::D...h::Perl(3pm)
π Log::Dispatch::Perl β the manual, but make it make sense π
okay bestie, so this is the page for Log::Dispatch::Perl(3pm) from the User Contributed Perl Documentation, and yes the header gets truncated to Log::D...h::Perl(3pm) because the terminal has no chill. Anyway. Sit down, grab a strawberry π, we're logging with plain old core Perl and it's lowkey iconic.
β¨ NAME β¨
Log::Dispatch::Perl β use core Perl functions for logging. like, the functions that already live in Perl's house. no extra dependencies, no drama. π
πΈ VERSION πΈ
version 0.05
π SYNOPSIS π
here's the whole vibe, copy-paste-able and everything:
use Log::Dispatch::Perl ();
my $dispatcher = Log::Dispatch->new;
$dispatcher->add( Log::Dispatch::Perl->new(
name => 'foo',
min_level => 'info',
action => { debug => '',
info => '',
notice => 'warn',
warning => 'warn',
error => 'die',
critical => 'die',
alert => 'croak',
emergency => 'croak',
},
) );
$dispatcher->warning( "This is a warning" );
so you spin up a Log::Dispatch dispatcher, you add a Log::Dispatch::Perl to it, you hand it a name, a min_level, and an action hash that maps each log level to a core Perl thing to do, and then you justβ¦ log. $dispatcher->warning( "This is a warning" ). periodt. π₯
π¦ DESCRIPTION π¦
The Log::Dispatch::Perl module offers a logging alternative using standard Perl core functions. It allows you to fall back to the common Perl alternatives for logging, such as warn and cluck. It also adds the possibility for a logging action to halt the current environment, such as with die and croak.
ngl that last part is the spicy bit β some actions will straight-up stop everything, so don't be surprised when your program goes π bye. the way that's a feature and not a bug, iykyk.
π POSSIBLE ACTIONS π
here's everything you can put in that action hash, listed in alphabetical order because we're organised like that β¨
π (absent or empty string or undef)
Indicates no action should be executed. Default for log levels debug and info.
so if you leave it out, or you pass an empty string, or you pass undef β nothing happens. it's giving "silent treatment" and honestly? valid. that's the default for debug and info.
π carp
Indicates a carp action should be executed. See "carp" in Carp. Halts execution.
β οΈ heads up bestie: this one halts execution. the party stops. π
π cluck
Indicates a cluck action should be executed. See "cluck" in Carp. Does not halt execution.
this one just clucks at you and keeps it moving. no halt. we love a non-disruptive queen π
π confess
Indicates a confess action should be executed. See "confess" in Carp. Halts execution.
full confession, full drama, halts execution. it's giving main character exit. π
π croak
Indicates a croak action should be executed. See "croak" in Carp. Halts execution.
Halts execution. that's it, that's the tweet.
π die
Indicates a die action should be executed. See "die" in perlfunc. Halts execution.
Halts execution. yeah. it does exactly what you think it does. πͺ¦
π warn
Indicates a warn action should be executed. See "warn" in perlfunc. Does not halt execution.
just a lil warning, no halting, we continue on our merry way. π
π«Ά SUPPORT π«Ά
Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Log-Dispatch-Perl> (or bug-Log-Dispatch-Perl@rt.cpan.org <mailto:bug-Log-Dispatch-Perl@rt.cpan.org>).
I am also usually active on irc, as 'ether' at irc.perl.org and irc.freenode.org.
so if something's busted, hit the tracker or the mail, or just find 'ether' on irc. they're around. π«Ά
π AUTHOR π
Elizabeth Mattijsen (liz@dijkmat.nl)
π CONTRIBUTOR π
Karen Etheridge <ether@cpan.org>
π COPYRIGHT AND LICENCE π
This software is copyright (c) 2020 by Elizabeth Mattijsen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, bestie. this one came fromperl v5.30.2and it's dated2020-05-18β that's theLog::D...h::Perl(3pm)footer, folded up all cute so you don't have to squint at it. go log something and slay πβ¨π
π¦ where this page comes from
- debian bookworm: liblog-dispatch-perl-perl 0.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: liblog-dispatch-perl-perl 0.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: liblog-dispatch-perl-perl 0.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: liblog-dispatch-perl-perl 0.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: liblog-dispatch-perl-perl 0.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liblog-dispatch-perl-perl 0.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms