Rene Schickbauer > Maplat-0.995 > Maplat::Helpers::TextLogger

Download:
Maplat-0.995.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.995   Source  

NAME ^

Maplat::Helpers::TextLogger - log to STDOUT and a logfile

SYNOPSIS ^

  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

DESCRIPTION ^

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.

new

  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.

logLine

Takes one argument, the text we want to log.

alive

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.

AUTHOR ^

Rene Schickbauer, <rene.schickbauer@gmail.com>

COPYRIGHT AND LICENSE ^

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.

syntax highlighting: