1Log::Message::Item(3) User Contributed Perl DocumentationLog::Message::Item(3)
2
3
4

NAME

6       Log::Message::Item
7

SYNOPSIS

9           # Implicitly used by Log::Message to create Log::Message::Item objects
10
11           print "this is the message's id: ",     $item->id;
12
13           print "this is the message stored: ",   $item->message;
14
15           print "this is when it happened: ",     $item->when;
16
17           print "the message was tagged: ",       $item->tag;
18
19           print "this was the severity level: ",  $item->level;
20
21           $item->remove;  # delete the item from the stack it was on
22
23           # Besides these methods, you can also call the handlers on
24           # the object specificallly.
25           # See the Log::Message::Handlers manpage for documentation on what
26           # handlers are available by default and how to add your own
27

DESCRIPTION

29       Log::Message::Item is a class that generates generic Log items.  These
30       items are stored on a Log::Message stack, so see the Log::Message man‐
31       page about details how to retrieve them.
32
33       You should probably not create new items by yourself, but use the stor‐
34       ing mechanism provided by Log::Message.
35
36       However, the accessors and handlers are of interest if you want to do
37       fine tuning of how your messages are handled.
38
39       The accessors and methods are described below, the handlers are docu‐
40       mented in the Log::Message::Handlers manpage.
41

Methods and Accessors

43       remove
44
45       Calling remove will remove the object from the stack it was on, so it
46       will not show up any more in subseqent fetches of messages.
47
48       You can still call accessors and handlers on it however, to handle it
49       as you will.
50
51       id
52
53       Returns the internal ID of the item. This may be usefull for comparing
54       since the ID is incremented each time a new item is created.  There‐
55       fore, an item with ID 4 must have been logged before an item with ID 9.
56
57       when
58
59       Returns the timestamp of when the message was logged
60
61       message
62
63       The actual message that was stored
64
65       level
66
67       The severity type of this message, as well as the name of the handler
68       that was called upon storing it.
69
70       tag
71
72       Returns the identification tag that was put on the message.
73
74       shortmess
75
76       Returns the equivalent of a "Carp::shortmess" for this item.  See the
77       "Carp" manpage for details.
78
79       longmess
80
81       Returns the equivalent of a "Carp::longmess" for this item, which is
82       essentially a stack trace.  See the "Carp" manpage for details.
83
84       parent
85
86       Returns a reference to the Log::Message object that stored this item.
87       This is usefull if you want to have access to the full stack in a han‐
88       dler.
89

SEE ALSO

91       Log::Message, Log::Message::Handlers, Log::Message::Config
92

AUTHOR

94       This module by Jos Boumans <kane@cpan.org>.
95

Acknowledgements

97       Thanks to Ann Barcomb for her suggestions.
98
100       This module is copyright (c) 2002 Jos Boumans <kane@cpan.org>.  All
101       rights reserved.
102
103       This library is free software; you may redistribute and/or modify it
104       under the same terms as Perl itself.
105
106
107
108perl v5.8.8                       2003-05-07             Log::Message::Item(3)
Impressum