.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 "Agent::Message 3pm" .TH Agent::Message 3pm "2021-02-22" "perl v5.32.1" "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::Agent::Message \- a log message .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& require Log::Agent::Message; \& \& my $msg = Log::Agent::Message\->make("string"); \& $msg\->prepend("string"); \& $msg\->append("string"); \& my $copy = $msg\->clone; \& \& print "Message is $msg\en"; # overloaded stringification .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The Log::Agent::Message class represents an original log message (a string) to which one may prepend or append other strings, but with the special property that prepended strings aggregate themselves in \s-1FIFO\s0 order, whilst appended strings aggregate themselves in \s-1LIFO\s0 order, which is counter-intuitive at first sight. .PP In plain words, this means that the last routine that prepends something to the message will get its prepended string right next to the original string, regardless of what could have been prepended already. The behaviour is symetric for appending. .SH "INTERFACE" .IX Header "INTERFACE" The following routines are available: .IP "append($str)" 4 .IX Item "append($str)" Append suppled string \f(CW$str\fR to the original string (given at creation time), at the head of all existing appended strings. .IP "append_last($str)" 4 .IX Item "append_last($str)" Append suppled string \f(CW$str\fR to the original string (given at creation time), at the tail of all existing appended strings. .IP "clone" 4 .IX Item "clone" Clone the message. This is not a shallow clone, because the list of prepended and appended strings is recreated. However it is not a deep clone, because the items held in those lists are merely copied (this would matter only when other objects with overloaded stringification routines were supplied to \fBprepend()\fR and \fBappend()\fR, which is not the case today in the basic Log::Agent framework). .IP "make($string)" 4 .IX Item "make($string)" This is the creation routine. .IP "prepend($str)" 4 .IX Item "prepend($str)" Prepend supplied string \f(CW$str\fR to the original string (given at creation time), at the tail of all existing prepended strings. .IP "prepend_first($str)" 4 .IX Item "prepend_first($str)" Prepend supplied string \f(CW$str\fR to the original string (given at creation time), at the head of all existing prepended strings. .IP "stringify" 4 .IX Item "stringify" This is the overloaded "" operator, which returns the complete string composed of all the prepended strings, the original string, and all the appended strings. .SH "AUTHOR" .IX Header "AUTHOR" Raphael Manfredi \fI\fR .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBLog::Agent\fR\|(3).