Log::D...Config(3pm)

πŸ“¦
version 1.04 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Log::Dispatch::Configurator::AppConfig β€” bestie, it's the configurator implementation that runs on AppConfig πŸ’…

(also the manual is filed under Log::D...Config(3pm) in the User Contributed Perl Documentation, because apparently we're too iconic for a full name in the header πŸŽ€)


🌸 SYNOPSIS 🌸

okay so here's the whole vibe, copy-paste ready:

use Log::Dispatch::Config;
use Log::Dispatch::Configurator::AppConfig;

my $config = Log::Dispatch::Configurator::AppConfig->new('log.cfg');
Log::Dispatch::Config->configure($config);

# nearby piece of code
my $log = Log::Dispatch::Config->instance;

like… you make the config object, you hand it to Log::Dispatch::Config->configure, and then any random nearby piece of code can just grab ->instance. no cap, that's the entire flex 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

Log::Dispatch::Configurator::AppConfig is an implementation of Log::Dispatch::Configurator that uses the AppConfig format. here's what a sample config file looks like, and yes it's giving organized:

dispatchers = file screen

file.class = Log::Dispatch::File
file.min_level = debug
file.filename = /path/to/log
file.mode = append
file.format = [%d] [%p] %m at %F line %L%n

screen.class = Log::Dispatch::Screen
screen.min_level = info
screen.stderr = 1
screen.format = %m

and guess what β€” you can also use ini style grouping if that's more your aesthetic:

[file]
class = Log::Dispatch::File
min_level = debug

[screen]
class = Log::Dispatch::Screen
min_level = info
🚨 okay important warning moment: if you use _ (underscore) in a dispatcher name, something very bad may happen. it is safe when you avoid doing so. so like… don't. literally just don't. πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

Tatsuhiko Miyagawa <miyagawa@bulknews.net>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. 🌈 (slay licensing, honestly)


πŸ’– SEE ALSO πŸ’–

  • Log::Dispatch::Config
  • AppConfig

and that's the page, bestie 🧚 β€” this one shipped as perl v5.34.0, dated 2022-06-15, filed under Log::D...Config(3pm) in the User Contributed Perl Documentation. go forth and configure your dispatchers, just keep those underscores out of the name βœ¨πŸ’…

πŸ“¦ where this page comes from