Courie...r::File(3pm)
π Courier::Filter::Logger::File π
okay bestie, so this is a page from the User Contributed Perl Documentation for Courier::Filter::Logger::File β the Perl 3pm manual, if you're keeping track πβ¨. Buckle up, it's lowkey iconic.
πΈ NAME πΈ
Courier::Filter::Logger::File β the file logger for the Courier::Filter framework. that's it, that's the whole vibe π
β¨ SYNOPSIS β¨
use Courier::Filter::Logger::File;
my $logger = Courier::Filter::Logger::File->new(
file_name => $file_name
);
# For use in an individual filter module:
my $module = Courier::Filter::Module::My->new(
...
logger => $logger,
...
);
# For use as a global Courier::Filter logger object:
my $filter = Courier::Filter->new(
...
logger => $logger,
...
);
like, copy-paste it, bestie, it's giving plug and play π
π¦ DESCRIPTION π¦
this class is a file logger class, and it's here to hang out with Courier::Filter and all its filter modules π«Ά. it inherits from Courier::Filter::Logger::IOHandle β so it's literally the child of an icon, no cap π
π Constructor π
here's the constructor, bestie:
new(%options)β returnsCourier::Filter::Logger::File; throwsCourier::Error.
it creates a brand-new logger that logs messages as lines to a file. it opens the file for writing, and creates it if it doesn't exist yet (yes, it does that β¨).
%options is a list of key/value pairs, and honestly you can pass any of these:
file_nameβ Required. it's the name of the file where the log messages get written. no file name, no vibe, fr fr.timestampβ a boolean that controls whether every log message line gets prefixed with a timestamp (in local time, in ISO format). defaults to false. so if you want timestamps, you gotta say so π
π Instance methods π
these instance methods are provided, inherited from Courier::Filter::Logger::IOHandle:
log_error($text)β throws Perl exceptions. logs the error message you hand it as$text(a string, and yes it may contain newlines, live your truth). it prefixes each line with a timestamp β but only if the"timestamp"option was set through the constructor. otherwise, no timestamps, sorry bestie πlog_rejected_message($message, $reason)β throws Perl exceptions. logs theCourier::Messagegiven as$messageas having been rejected due to$reason(a string which may contain newlines). dramatic? a little. accurate? yes. π
π SEE ALSO π
go check out these icons too:
Courier::Filter::Logger::IOHandleCourier::Filter::LoggerCourier::Filter::Overview
and bestie, for AVAILABILITY, SUPPORT, and LICENSE info, you gotta look at Courier::Filter::Overview. that's where the whole lore lives πβ¨
π AUTHOR π
Julian Mehnle <julian@mehnle.net> β we stan a legend π«Ά
okay that's the whole page, bestie, you ate that π
β¨. this was Courier::Filter::File from perl v5.34.0, dated 2022-10-21 β the User Contributed Perl Documentation, periodt. now go log something iconic ππ¦π
π¦ where this page comes from
- debian bookworm: courier-filter-perl 0.200+ds-6 Β· Artistic-1.0-Perl OR GPL-2.0-or-later
- debian trixie: courier-filter-perl 0.200+ds-6 Β· Artistic-1.0-Perl OR GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms