Log::Me...andlers(3)
π NAME π
okay so bestie, you're reading Log::Me...andlers(3) β a User Contributed Perl Documentation page for Log::Message::Handlers, aka the message handlers for Log::Message. it's giving "the little handlers that handle your log messages," and honestly? iconic. π
β¨
β¨ SYNOPSIS β¨
# Implicitly used by Log::Message to serve as handlers for
# Log::Message::Item objects
# Create your own file with a package called
# Log::Message::Handlers to add to the existing ones, or to even
# overwrite them
$item->carp;
$item->trace;
πΈ DESCRIPTION πΈ
Log::Message::Handlers provides handlers for Log::Message::Item objects. the handler that corresponds to the level (see the Log::Message::Item manpage for an explanation about levels) will be called automatically upon storing the error. no cap, that's the whole vibe. π
handlers may also explicitly be called on an Log::Message::Item object if one so desires (see the Log::Message manpage on how to retrieve the Item objects). okayyy, options π
π¦ Default Handlers π¦
π log π
Will simply log the error on the stack, and do nothing special. lowkey chill, zero drama β¨
π carp π
Will carp (see the Carp manpage) with the error, and add the timestamp of when it occurred. yes bestie, timestamps are coming with us π°οΈ
π«§ croak π«§
Will croak (see the Carp manpage) with the error, and add the timestamp of when it occurred. croak era, but make it timestamped π
π cluck π
Will cluck (see the Carp manpage) with the error, and add the timestamp of when it occurred. cluck cluck, bestie π£
π confess π
Will confess (see the Carp manpage) with the error, and add the timestamp of when it occurred. full confession, with receipts π§Ύ
π die π
Will simply die with the error message of the item. dramatic exit, but make it item-based π
β οΈ warn β οΈ
Will simply warn with the error message of the item. a gentle heads-up, no cap π«Ά
π trace π
Will provide a traceback of this error item back to the first one that occurred, clucking with every item as it comes across it. the way it just keeps clucking through the whole timeline is so main character energy πβ¨
π§ Custom Handlers π§
so if you wish to provide your own handlers, you can simply do the following:
- create a file that holds a package by the name of
"Log::Message::Handlers" - create subroutines with the same name as the levels you wish to handle in the
Log::Messagemodule (see theLog::Messagemanpage for explanation on levels) - require that file in your program, or add it in your configuration (see the
Log::Message::Configmanpage for explanation on how to use a config file)
and that is it, the handler will now be available to handle messages for you. slay π«Ά
the arguments a handler may receive are those specified by the "extra" key, when storing the message. see the Log::Message manpage for details on the arguments. iykyk π
π SEE ALSO π
Log::Message, Log::Message::Item, Log::Message::Config
π AUTHOR π
This module by Jos Boumans <kane@cpan.org>.
π Acknowledgements π
Thanks to Ann Barcomb for her suggestions.
π COPYRIGHT π
This module is copyright (c) 2002 Jos Boumans <kane@cpan.org>. All rights reserved.
This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.
mwah π that's the whole page, bestie. it's from perl v5.42.0, dated 2014-07-27, and it's the Log::Me...andlers(3) manual page. go handle those messages and slay π«Άπ
π¦ where this page comes from
- opensuse-leap 16.0: perl-Log-Message 0.08-bp160.1.2 Β· Artistic-1.0 or GPL-1.0+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms