Log::Di...ch::Code(3)

πŸ’– Log::Dispatch::Code β€” the Perl manpage, but make it cute ✨

okay bestie, so this is a page from the User Contributed Perl Documentation section (perl v5.42.0, if you're keeping score πŸŽ€), and it's literally all about Log::Dispatch::Code β€” an object for logging to a subroutine reference. iykyk πŸ’…


✨ NAME ✨

Log::Dispatch::Code β€” Object for logging to a subroutine reference 🫢

🌸 VERSION 🌸

version 2.71 β€” yes ma'am, we're on 2.71 ⭐

πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the whole vibe in code form, copy it exactly bestie:

use Log::Dispatch;

my $log = Log::Dispatch->new(
    outputs => [
        [
            'Code',
            min_level => 'emerg',
            code      => \&_log_it,
        ],
    ]
);

sub _log_it {
    my %p = @_;

    warn $p{message};
}

like... the way that just works πŸ˜­πŸ‘‘

πŸ“ DESCRIPTION πŸ“

This module supplies a simple object for logging to a subroutine reference. that's it, that's the whole personality β€” simple, focused, iconic. no cap πŸ’–

πŸ’œ CONSTRUCTOR πŸ’œ

The constructor takes the following parameters in addition to the standard parameters documented in Log::Dispatch::Output β€” so don't come for it about the standard stuff, go read that page, bestie πŸ’…

  • code ($) β€” The subroutine reference. that's your little function, your main character, the one doing the actual logging 🧚

πŸ”₯ HOW IT WORKS πŸ”₯

The subroutine you provide will be called with a hash of named arguments. yep, a hash. named args. we love a well-labeled data structure ✨

The two arguments are:

  • level β€” The log level of the message. This will be a string like "info" or "error". literally just a string, nothing spooky 🌈
  • message β€” The message being logged. the actual content, the star of the show πŸ‘‘

πŸ™ˆ SUPPORT πŸ™ˆ

Bugs may be submitted at <https://github.com/houseabsolute/Log-Dispatch/issues>. β€” please do report them, we're not monsters πŸ’€

🧚 SOURCE 🧚

The source code repository for Log-Dispatch can be found at <https://github.com/houseabsolute/Log-Dispatch>. β€” go look, it's giving open source excellence πŸ¦‹

πŸ‘‘ AUTHOR πŸ‘‘

Dave Rolsky <autarch@urth.org> β€” legend behaviour, we stan 🫢

This software is Copyright (c) 2023 by Dave Rolsky.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)

The full text of the license can be found in the LICENSE file included with this distribution. read it, bestie, it's important πŸ’–


fr fr that's the whole page β€” every flag, every arg, every link, nothing skipped, periodt πŸ’…βœ¨

and that's a wrap on the Log::Dispatch::Code page, served up by perl v5.42.0 on 2023-04-21 from the User Contributed Perl Documentation β€” mwah, hope that slayed for you πŸŽ€πŸ’œπŸŒˆ

πŸ“¦ where this page comes from