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 the Log::Dispatch infrastructure has a large number of output TYPEs, and each one extends the Log::Dispatch::Output base-class. and no, you do not create these objects yourself β€” Log::Report is 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 in Log::Report::Dispatcher; default depends on mode.
  • callbacks => CODE|\@CODE β€” see Log::Dispatch::Output. default is [].
  • charset => CHARSET β€” defined in Log::Report::Dispatcher, default undef.
  • format_reason => 'UPPERCASE'|'LOWERCASE'|'UCFIRST'|'IGNORE'|CODE β€” defined in Log::Report::Dispatcher, default 'LOWERCASE'.
  • locale => LOCALE β€” defined in Log::Report::Dispatcher, default is the <system locale>.
  • max_level => $level β€” like min_level. default undef.
  • min_level => $level β€” restricts which messages get passed through, based on the $level β€” so this happens after the reason got translated into a Log::Dispatch compatible LEVEL. the default (debug) will use Log::Report restrictions only.
  • mode => 'NORMAL'|'VERBOSE'|'ASSERT'|'DEBUG'|0..3 β€” defined in Log::Report::Dispatcher, default 'NORMAL'.
  • to_level => \@PAIRS β€” see reasonToLevel(). default [].

πŸ‘‘ Attributes

extends "Attributes" in Log::Report::Dispatcher.

  • $obj->backend() β€” returns the Log::Dispatch::Output object that's being used for logging. that's your lil logging bestie right there 🫢
  • $obj->isDisabled() β€” inherited, see "Attributes" in Log::Report::Dispatcher.
  • $obj->mode() β€” inherited, see "Attributes" in Log::Report::Dispatcher.
  • $obj->name() β€” inherited, see "Attributes" in Log::Report::Dispatcher.
  • $obj->needs( [$reason] ) β€” inherited, see "Attributes" in Log::Report::Dispatcher.
  • $obj->type() β€” inherited, see "Attributes" in Log::Report::Dispatcher.

🌈 Logging

extends "Logging" in Log::Report::Dispatcher.

  • $any->addSkipStack(@CODE) β€” inherited, see "Logging" in Log::Report::Dispatcher.
  • $obj->close() β€” inherited, see "Logging" in Log::Report::Dispatcher.
  • $any->collectLocation() β€” inherited, see "Logging" in Log::Report::Dispatcher.
  • $any->collectStack( [$maxdepth] ) β€” inherited, see "Logging" in Log::Report::Dispatcher.
  • $obj->log(\%options, $reason, $message, $domain) β€” inherited, see "Logging" in Log::Report::Dispatcher.
  • $obj->reasonToLevel($reason) β€” returns a level that Log::Dispatch actually understands, based on a translation table. you can change it with new(to_level) ✨
  • $obj->skipStack() β€” inherited, see "Logging" in Log::Report::Dispatcher.
  • $any->stackTraceLine(%options) β€” inherited, see "Logging" in Log::Report::Dispatcher.
  • $obj->translate(\%options, $reason, $message) β€” inherited, see "Logging" in Log::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 by new(). 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