Plack:...ogWarn(3pm)

πŸ“¦
version 0.001002 Β· 4 versions
, in debian bookworm, ubuntu noble

πŸ’– Plack::Middleware::LogWarn β€” the vibe

ok so bestie, we're looking at Plack::Middleware::LogWarn, a lil Perl module that lives under the Plack namespace in the User Contributed Perl Documentation. It's giving "glow up your warnings" energy, and honestly? Iconic.


✨ NAME ✨

Plack::Middleware::LogWarn β€” she converts warns to log messages. That's the whole job. No cap. πŸŽ€


🌸 VERSION 🌸

version 0.001002


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's how you bring her into your builder block:

builder {
   enable 'LogWarn';
   $app;
}

and here's the glow-up version where she teams up with another logger middleware:

# use it with another logger middleware

builder {
   enable 'LogWarn';
   enable 'Log4perl', category => 'plack', conf => '/path/to/log4perl.conf';
   $app;
}

see how LogWarn goes first? she catches the warns, then Log4perl does the actual logging. teamwork, bestie. 🀝


πŸ’… DESCRIPTION πŸ’…

LogWarn is a Plack::Middleware component that will help you get warnings into a logger. that's literally her whole personality and honestly, we stan a specialist. πŸ’–

but like, she doesn't want to be the only one doing the work. you probably want to use some sort of real logging system β€” something like Log::Log4perl β€” paired with another Plack::Middleware such as Plack::Middleware::Log4perl. she's the bridge, not the destination. main character energy but make it collaborative. πŸ‘‘


πŸŽ€ CONFIGURATION πŸŽ€

  • logger β€” this one's optional, a coderef that will capture warnings. but bestie, if you don't pass one? by default she uses $env->{'psgix.logger'} with a level of warn. so it just works out of the box. periodt. ✨

🌈 SEE ALSO 🌈

  • Plack::Middleware::Log4perl β€” her partner in crime, iykyk 🫢

πŸ“ CREDITS πŸ“

huge thank you to Micro Technology Services, Inc. for funding the initial development of this module β€” fr fr, none of this would exist without y'all. πŸ’œ

and to frew (Arthur Axel "fREW" Schmidt <frioux@gmail.com>) β€” thank you for his extensive patience and assistance. extensive patience. bestie that's a mood and also a compliment and also honestly so real. 😭


πŸ’€ AUTHOR πŸ’€

Geoffrey Darling <geoffreydarling@gmail.com>


This software is copyright (c) 2011 by Geoffrey Darling.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


πŸ’– so yes, go forth, log your warns, and remember: psgix.logger has your back by default. no setup required, she's just like that. 🌸

and that's the whole page, babes β€” documented with perl v5.34.0, dated 2022-06-16, and shipped under the Plack:...ogWarn(3pm) header. mwah. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from