Logger::Simple

Logger::Simple is an implementation of the Simran-Log-Log and Simran-Error-Error modules.
Download

Logger::Simple Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Thomas Stanley
  • Publisher web site:
  • http://search.cpan.org/~tstanley/Logger-Simple-2.0/Simple.pm

Logger::Simple Tags


Logger::Simple Description

Logger::Simple is an implementation of the Simran-Log-Log and Simran-Error-Error modules. Logger::Simple is an implementation of the Simran-Log-Log and Simran-Error-Error modules.SYNOPSIS 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"); }newmy $log=Logger::Simple->new(LOG=>"/tmp/logfile");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.write$log->write("This is an error message");This method will write a message to the logfile, and will update the internal HISTORY array.retrieve_historymy @history = $log->retrieve_history; my $msg = $log->retrieve_history;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 arrayclear_history$log->clear_history;This method will clear the internal HISTORY arrayThis 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. Requirements: · Perl


Logger::Simple Related Software