Log::R...spatch(3pm)
π¦ Log::R...spatch β bestie edition π
okay so like, the manual page is Log::R...spatch(3pm) from the User Contributed Perl Documentation section, and we're gonna get into it. strap in π
β¨ NAME β¨
Log::Report::Dispatcher::LogDispatch β send messages to Log::Dispatch back-end, fr fr π¨
πΈ INHERITANCE πΈ
so the family tree is giving:
Log::Report::Dispatcher::LogDispatch
is a Log::Report::Dispatcher
it's a whole nepo baby situation and honestly? we love that for it π
β SYNOPSIS β
here's the vibe, copy-paste ready:
use Log::Dispatch::File;
dispatcher Log::Dispatch::File => 'logger', accept => 'NOTICE-',
filename => 'logfile', to_level => [ 'ALERT-' => 'err' ];
# disable default dispatcher
dispatcher close => 'logger';
that last one is you saying bye to the default dispatcher, no hard feelings π
π DESCRIPTION π
so this dispatcher makes output go to a Log::Dispatch back-end. and heads up bestie β it will NOT be automatically installed for you π you gotta do that yourself.
now the tea: the REASON of a message often has names that are lowkey similar to the log-levels that Log::Dispatch uses. but no β they're built different. the REASON in Log::Report limits what the programmer is responsible for: it's just saying why the message happened, and whether they could handle the situation or not. the Log::Dispatch levels? those are for the users of the program. and the thing is, the programmer doesn't know anything about the application in the general case π and that is the cause of so much of the trickery in Perl programs. yeah. it's giving chaos.
the default translation table is listed below (that's the min_level / max_level / to_level situation, iykyk). you can change the mapping using new(to_level). there's an example in SYNOPSIS if you need a visual π«Ά
also it extends "DESCRIPTION" in Log::Report::Dispatcher β so go look at that too.
π§ METHODS π§
extends "METHODS" in Log::Report::Dispatcher. it's methods all the way down π
π Constructors
extends "Constructors" in Log::Report::Dispatcher.
$class->new($type, $name, %options)β so theLog::Dispatchinfrastructure has a large number of output TYPEs, and each one extends theLog::Dispatch::Outputbase-class. and no, you do not create these objects yourself βLog::Reportis doing it for you, periodt.
the Log::Dispatch back-ends are very careful about validating their parameters, so you're gonna need to restrict the options to whatever the specific back-end actually supports. check their respective manual-pages, bestie π the errors those back-ends produce are honestly pretty horrible and untranslated β sorry π. improves base, see "Constructors" in Log::Report::Dispatcher.
here's the whole option table, nothing skipped, all facts intact:
-Option --Defined in --Default
accept Log::Report::Dispatcher depend on mode
callbacks []
charset Log::Report::Dispatcher undef
format_reason Log::Report::Dispatcher 'LOWERCASE'
locale Log::Report::Dispatcher <system locale>
max_level undef
min_level debug
mode Log::Report::Dispatcher 'NORMAL'
to_level []
and the options one by one:
accept => $reasons|\@reasonsβ the reasons you're willing to accept, defined inLog::Report::Dispatcher; default depends on mode.callbacks => CODE|\@CODEβ seeLog::Dispatch::Output. default is[].charset => CHARSETβ defined inLog::Report::Dispatcher, defaultundef.format_reason => 'UPPERCASE'|'LOWERCASE'|'UCFIRST'|'IGNORE'|CODEβ defined inLog::Report::Dispatcher, default'LOWERCASE'.locale => LOCALEβ defined inLog::Report::Dispatcher, default is the<system locale>.max_level => $levelβ likemin_level. defaultundef.min_level => $levelβ restricts which messages get passed through, based on the$levelβ so this happens after the reason got translated into aLog::Dispatchcompatible LEVEL. the default (debug) will useLog::Reportrestrictions only.mode => 'NORMAL'|'VERBOSE'|'ASSERT'|'DEBUG'|0..3β defined inLog::Report::Dispatcher, default'NORMAL'.to_level => \@PAIRSβ seereasonToLevel(). default[].
π Attributes
extends "Attributes" in Log::Report::Dispatcher.
$obj->backend()β returns theLog::Dispatch::Outputobject that's being used for logging. that's your lil logging bestie right there π«Ά$obj->isDisabled()β inherited, see "Attributes" inLog::Report::Dispatcher.$obj->mode()β inherited, see "Attributes" inLog::Report::Dispatcher.$obj->name()β inherited, see "Attributes" inLog::Report::Dispatcher.$obj->needs( [$reason] )β inherited, see "Attributes" inLog::Report::Dispatcher.$obj->type()β inherited, see "Attributes" inLog::Report::Dispatcher.
π Logging
extends "Logging" in Log::Report::Dispatcher.
$any->addSkipStack(@CODE)β inherited, see "Logging" inLog::Report::Dispatcher.$obj->close()β inherited, see "Logging" inLog::Report::Dispatcher.$any->collectLocation()β inherited, see "Logging" inLog::Report::Dispatcher.$any->collectStack( [$maxdepth] )β inherited, see "Logging" inLog::Report::Dispatcher.$obj->log(\%options, $reason, $message, $domain)β inherited, see "Logging" inLog::Report::Dispatcher.$obj->reasonToLevel($reason)β returns a level thatLog::Dispatchactually understands, based on a translation table. you can change it withnew(to_level)β¨$obj->skipStack()β inherited, see "Logging" inLog::Report::Dispatcher.$any->stackTraceLine(%options)β inherited, see "Logging" inLog::Report::Dispatcher.$obj->translate(\%options, $reason, $message)β inherited, see "Logging" inLog::Report::Dispatcher.
π DETAILS π
extends "DETAILS" in Log::Report::Dispatcher. that's it, that's the section π
π DIAGNOSTICS π
- Error: Log::Dispatch level
'$level'not understood β cast bynew(). yeah she will literally tell you the level made no sense π₯
πΈ SEE ALSO πΈ
this module is part of Log-Report version 1.46, built on June 16, 2026.
Website: http://perl.overmeer.net/CPAN/ β go peek, it's iconic π
π LICENSE π
for contributors see file ChangeLog.
this software is copyright (c) 2007-2026 by Mark Overmeer.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, legally speaking π
and that's the whole page, bestie π this was Log::R...spatch(3pm) under perl v5.40.1, dated 2026-07-05 β love you, bye! πβ¨π¦
π¦ where this page comes from
- ubuntu stonking: liblog-report-perl 1.46-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