Courie...:Syslog(3pm)

πŸ“¦
version 0.200 Β· 2 versions
, in debian bookworm, debian trixie

πŸ’– Courie...:Syslog πŸ’–

okay bestie, so this little cutie lives in the User Contributed Perl Documentation section of the manual β€” it's Courier::Filter::Logger::Syslog, and it's the syslog logger for the Courier::Filter framework. she's giving main character energy in the logs. πŸŽ€


✨ NAME ✨

Courier::Filter::Logger::Syslog β€” the syslog logger for the Courier::Filter framework. no cap, that's literally the whole job description. πŸ’…


🌸 SYNOPSIS 🌸

here's the vibe, copy-paste friendly:

use Courier::Filter::Logger::Syslog;

my $logger = Courier::Filter::Logger::Syslog->new();

# 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… you make the logger, you hand it to a module, or you hand it to the whole filter. either way she's logging. periodt. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so this class is a syslog logger β€” you use it with Courier::Filter and its filter modules. and the family tree?? she's derived from Courier::Filter::Logger::IOHandle. so she inherited the genes, and that's lowkey why half the methods below aren't even hers originally, they're the family's. iykyk. 🧬✨

πŸŽ€ Constructor

here's the one constructor you get, bestie:

  • new: returns Courier::Filter::Logger::Syslog; throws Courier::Error β€” spawns a brand new logger that logs messages to syslog. that's it, that's the whole origin story. 🌈

πŸ’… Instance methods

these are the instance methods you get, and heads up: they are inherited from Courier::Filter::Logger::IOHandle. so cute of her to share. 🫢

  • log_error($text): throws Perl exceptions β€” logs the error message you pass as $text (it's a string, and yes it may contain newlines, she can handle it, multi-line errors are valid).
  • log_rejected_message($message, $reason): throws Perl exceptions β€” logs the Courier::Message passed as $message as having been rejected because of $reason (also a string, also may contain newlines, also totally fine).
⚠️ ok real talk: both of these be throwing Perl exceptions. don't sleep on that, be ready to catch them. 😭

⭐ SEE ALSO ⭐

go read your sisters, they're all iconic:

  • Courier::Filter::Logger::IOHandle
  • Courier::Filter::Logger
  • Courier::Filter::Overview

and for the AVAILABILITY, SUPPORT, and LICENSE info?? that all lives over in Courier::Filter::Overview. go check her out, she's got the receipts. πŸ“œπŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

Julian Mehnle <julian@mehnle.net> β€” thank you for your service, legend. πŸ«‘πŸ’–


and that's the whole page, bestie!! this one shipped as part of User Contributed Perl Documentation, riding along with perl v5.34.0, dated 2022-10-21. slay, ate, no crumbs left. πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from