Log::D...h::Perl(3pm)

πŸ“¦
version 0.05 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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>

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 from perl v5.30.2 and it's dated 2020-05-18 β€” that's the Log::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