Log::Message::Item(3)

hey bestie! welcome to the Log::Message::Item(3) page from the User Contributed Perl Documentation β€” it's giving β€œmessage objects with main character energy” and I'm obsessed πŸ’–βœ¨

πŸ’– NAME πŸ’–

Log::Message::Item β€” message objects for Log::Message, periodt. πŸŽ€

✨ SYNOPSIS ✨

okay so here's the whole vibe in code, bestie β€” literally the exact synopsis:

# Implicitly used by Log::Message to create Log::Message::Item objects

print "this is the message's id: ",     $item->id;

print "this is the message stored: ",   $item->message;

print "this is when it happened: ",     $item->when;

print "the message was tagged: ",       $item->tag;

print "this was the severity level: ",  $item->level;

$item->remove;  # delete the item from the stack it was on

# Besides these methods, you can also call the handlers on
# the object specifically.
# See the Log::Message::Handlers manpage for documentation on what
# handlers are available by default and how to add your own

πŸ¦‹ DESCRIPTION πŸ¦‹

Log::Message::Item is a class that generates generic Log items. these items are stored on a Log::Message stack, so see the Log::Message manpage for the details on how to retrieve them. 🫢

bestie, you should probably not create new items by yourself β€” use the storing mechanism provided by Log::Message instead. no cap.

but the accessors and handlers? those are highkey interesting if you want to do fine tuning of how your messages are handled. πŸ”₯

the accessors and methods are described below; the handlers are documented in the Log::Message::Handlers manpage. iykyk.

🌸 Methods and Accessors 🌸

πŸ’… remove

calling remove will remove the object from the stack it was on, so it will not show up any more in subsequent fetches of messages. bye bestie πŸ‘‹

you can still call accessors and handlers on it however, to handle it as you will. it's giving β€œstill iconic after removal” energy. πŸ’…

πŸ’… id

returns the internal ID of the item. this may be useful for comparing since the ID is incremented each time a new item is created. therefore, an item with ID 4 must have been logged before an item with ID 9. math is mathing ✨

πŸ’… when

returns the timestamp of when the message was logged. clock it, bestie ⏰

πŸ’… message

the actual message that was stored. the main character of this whole object, honestly. 🌟

πŸ’… level

the severity type of this message, as well as the name of the handler that was called upon storing it. so it's both the vibe and the handler name β€” love that for us. πŸ”₯

πŸ’… tag

returns the identification tag that was put on the message. tag it, bestie 🏷️

πŸ’… shortmess

returns the equivalent of a Carp::shortmess for this item. see the Carp manpage for details. short and cute, just like this method. πŸŽ€

πŸ’… longmess

returns the equivalent of a Carp::longmess for this item, which is essentially a stack trace. see the Carp manpage for details. it's giving detective mode πŸ”

πŸ’… parent

returns a reference to the Log::Message object that stored this item. this is useful if you want to have access to the full stack in a handler. family tree reveal πŸ‘‘

πŸ‘€ SEE ALSO πŸ‘€

  • Log::Message
  • Log::Message::Handlers
  • Log::Message::Config

🫢 AUTHOR 🫢

this module by Jos Boumans kane@cpan.org. king behavior πŸ‘‘

πŸŽ€ Acknowledgements πŸŽ€

thanks to Ann Barcomb for her suggestions. we love a helpful bestie πŸ’–

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. slay, free software realness πŸ’…


okay that's the whole page, bestie! this was Log::Message::Item(3) from perl v5.42.0, dated 2014-07-27 β€” go off and log those messages, you absolute icon πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from