Rex::Logger(3)
π Rex::Logger(3) π
okay so bestie, welcome to Rex::Logger β straight out of the User Contributed Perl Documentation section, and honestly? she's iconic for it. this is the manual page for the logging module, and yes, the vibe is very "your fave little scribe keeping receipts of everything that happens." π
β¨ NAME β¨
Rex::Logger β the Logging Module. that's it. that's the name. she logs. periodt. π
πΈ DESCRIPTION πΈ
this module is the logging module. like, the one. and here's the fun part, bestie: you can define custom logformats. your logs, your rules, your main character energy. π¦
π«Ά SYNOPSIS π«Ά
ok so you set the format like this:
$Rex::Logger::format = '[%D] %s';
# will output something like
# [2012-04-12 18:35:12] Installing package vim
and that'll spit out something like:
[2012-04-12 18:35:12] Installing package vim
orrrr, if you're feeling extra fancy:
$Rex::Logger::format = '%h - %D - %s';
# will output something like
# srv001 - 2012-04-12 18:35:12 - Installing package vim
which gives you:
srv001 - 2012-04-12 18:35:12 - Installing package vim
look at her go ππ
π VARIABLES π
π $debug
setting this variable to 1 will enable debug logging. yes, all the messy little details get to come to the party. π
$Rex::Logger::debug = 1;
π§ $silent
if you set this variable to 1, nothing will be logged. absolutely nothing. silence. ghost mode. not a single peep. π
$Rex::Logger::silent = 1;
β $format
you can define the logging format with the following parameters β these are the little magic tokens, iykyk:
%Dβ appends the current date inyyyy-mm-dd HH:mm:ssformat ποΈ%hβ the target host π₯οΈ%pβ the pid of the running process π’%lβ the loglevel (INFOorDEBUG) π%sβ the logstring βοΈ
and the default is: [%D] %l - %s
ngl bestie, that default is lowkey perfect. don't fix what isn't broken π
and that's the whole page, fr fr ππ
πΈ sign-off time, bestie πΈ β this gorgeous little doc is from perl v5.42.3, dated 2023-08-05, and it's the Rex::Logger(3) page itself. slay. go forth and log beautifully, bestie πβ¨π
π¦ where this page comes from
- nixos 26.05: perl5.42.3-Rex 1.14.3
- nixpkgs unstable: perl5.42.3-Rex 1.14.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms