.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Log::Message::Item 3" .TH Log::Message::Item 3 2024-09-01 "perl v5.40.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Log::Message::Item \- Message objects for Log::Message .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& # Implicitly used by Log::Message to create Log::Message::Item objects \& \& print "this is the message\*(Aqs 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 .Ve .SH DESCRIPTION .IX Header "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 about details how to retrieve them. .PP You should probably not create new items by yourself, but use the storing mechanism provided by Log::Message. .PP However, the accessors and handlers are of interest if you want to do fine tuning of how your messages are handled. .PP The accessors and methods are described below, the handlers are documented in the Log::Message::Handlers manpage. .SH "Methods and Accessors" .IX Header "Methods and Accessors" .SS remove .IX Subsection "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. .PP You can still call accessors and handlers on it however, to handle it as you will. .SS id .IX Subsection "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. .SS when .IX Subsection "when" Returns the timestamp of when the message was logged .SS message .IX Subsection "message" The actual message that was stored .SS level .IX Subsection "level" The severity type of this message, as well as the name of the handler that was called upon storing it. .SS tag .IX Subsection "tag" Returns the identification tag that was put on the message. .SS shortmess .IX Subsection "shortmess" Returns the equivalent of a \f(CW\*(C`Carp::shortmess\*(C'\fR for this item. See the \f(CW\*(C`Carp\*(C'\fR manpage for details. .SS longmess .IX Subsection "longmess" Returns the equivalent of a \f(CW\*(C`Carp::longmess\*(C'\fR for this item, which is essentially a stack trace. See the \f(CW\*(C`Carp\*(C'\fR manpage for details. .SS parent .IX Subsection "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. .SH "SEE ALSO" .IX Header "SEE ALSO" Log::Message, Log::Message::Handlers, Log::Message::Config .SH AUTHOR .IX Header "AUTHOR" This module by Jos Boumans . .SH Acknowledgements .IX Header "Acknowledgements" Thanks to Ann Barcomb for her suggestions. .SH COPYRIGHT .IX Header "COPYRIGHT" This module is copyright (c) 2002 Jos Boumans . All rights reserved. .PP This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.