Maplat::Helpers::TextLogger - log to STDOUT and a logfile
use Maplat::Helpers::TextLogger qw(tabsToTable normalizeString); my $logger = new Maplat::Helpers::TextLogger( appname => "myApp", logfile => "yada.log" ); $logger->log("Something happend"); $logger->alive; # Notify the user that we're still alive
This is a helper module to log to STDOUT as well as to a text file with the current date and time prefixed to the logline.
my $logger = new Maplat::Helpers::TextLogger( appname => "myApp", logfile => "yada.log" );
appname is the application name or some other unique identifier. logfile is the filename of the logfile we want to use.
Takes one argument, the text we want to log.
Log a "application_name is alive" log line. Use this if your program prints our log lines very infrequently to show that the application is still running. Every 5 to 10 minutes or so is a good rule of thumb.
Rene Schickbauer, <rene.schickbauer@gmail.com>
Copyright (C) 2008-2011 by Rene Schickbauer
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
To install Maplat, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Maplat
CPAN shell
perl -MCPAN -e shell install Maplat
For more information on module installation, please visit the detailed CPAN module installation guide.