Simple(3pm) | User Contributed Perl Documentation | Simple(3pm) |
Logger::Simple - Implementation of the Simran-Log-Log and Simran-Error-Error modules
use Logger::Simple; my $log=Logger::Simple->new(LOG=>"/tmp/program.log"); my $x=5;my $y=4; if($x>$y){ $log->write("\$x is greater than \$y"); }
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.
This method will write a message to the logfile, and will update the internal HISTORY array.
When called in scalar context, it will return the last message written to the HISTORY array. When called in a list context, it will return the entire HISTORY array
This method will clear the internal HISTORY array
None by default.
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.
My thanks also goes out once again to Damian Conway for Object Oriented Perl, and also to Sam Tregar, for his book "Writing Perl Modules for CPAN". Both were invaluable references for me.
I would also like to thank Jerry Heden for his Object::InsideOut module, which I used to create this module.
Thomas Stanley
Thomas_J_Stanley@msn.com
I can also be found on http://www.perlmonks.org as TStanley. You can also direct any questions concerning this module there as well.
Object::InsideOut
Simran::Log::Log
Simran::Error::Error
2020-01-28 | perl v5.30.0 |