.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" 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 "Simple 3pm" .TH Simple 3pm "2020-01-28" "perl v5.30.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" Logger::Simple \- Implementation of the Simran\-Log\-Log and Simran\-Error\-Error modules .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use Logger::Simple; \& my $log=Logger::Simple\->new(LOG=>"/tmp/program.log"); \& my $x=5;my $y=4; \& \& if($x>$y){ \& $log\->write("\e$x is greater than \e$y"); \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" .IP "new" 5 .IX Item "new" \&\f(CW\*(C`my $log=Logger::Simple\->new(LOG=>"/tmp/logfile");\*(C'\fR .Sp The new method creates the Logger::Simple object as an inside-out object. The Log parameter is a mandatory one that must be passed to the object at creation, or the object will fail. Upon creation, this method will also call the open_log method which opens the log file. .IP "write" 5 .IX Item "write" \&\f(CW\*(C`$log\->write("This is an error message");\*(C'\fR .Sp This method will write a message to the logfile, and will update the internal \&\s-1HISTORY\s0 array. .IP "retrieve_history" 5 .IX Item "retrieve_history" \&\f(CW\*(C`my @history = $log\->retrieve_history;\*(C'\fR \&\f(CW\*(C`my $msg = $log\->retrieve_history;\*(C'\fR .Sp When called in scalar context, it will return the last message written to the \&\s-1HISTORY\s0 array. When called in a list context, it will return the entire \s-1HISTORY\s0 array .IP "clear_history" 5 .IX Item "clear_history" \&\f(CW\*(C`$log\->clear_history;\*(C'\fR .Sp This method will clear the internal \s-1HISTORY\s0 array .SH "EXPORT" .IX Header "EXPORT" None by default. .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" This module is based on the Simran::Log::Log and Simran::Error::Error modules. I liked the principle behind them, but felt that the interface could be a bit better. .PP My thanks also goes out once again to Damian Conway for Object Oriented Perl, and also to Sam Tregar, for his book \*(L"Writing Perl Modules for \s-1CPAN\*(R".\s0 Both were invaluable references for me. .PP I would also like to thank Jerry Heden for his Object::InsideOut module, which I used to create this module. .SH "AUTHOR" .IX Header "AUTHOR" Thomas Stanley .PP Thomas_J_Stanley@msn.com .PP I can also be found on http://www.perlmonks.org as TStanley. You can also direct any questions concerning this module there as well. .SH "COPYRIGHT" .IX Header "COPYRIGHT" .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBperl\fR\|(1). .PP Object::InsideOut .PP Simran::Log::Log .PP Simran::Error::Error