in reply to Log Files Module

Hi,

Rather than looking for a specific module to redirect a your error and warnings, why cant you simple write a small module which redirects your STDERR and STDOUT to a log file. tie that module in your program.

Is my suggestion acceptable. Because i did this way and i find it very useful and handy because i can tune accordingly to my need.

A small psuedo code for you...it will be help full..i think..

sub setlog { unless( ($log = tie(*STDOUT, 'your::module', ">>$LOGFILE")) +) } -------------- your::module ------------- sub PRINT { $fh # file handle my $line = (caller(0))[2]; syswrite $fh, sprintf("[ %-18.18s %s %4.4s ] %s %s", "$script $lin +e", }
-Prasanna.K

Replies are listed 'Best First'.
Re^2: Log Files Module
by Anonymous Monk on Dec 28, 2005 at 17:31 UTC
    Like your approach, I am going to do some tests based on this code style.
Re^2: Log Files Module
by Anonymous Monk on Dec 28, 2005 at 17:35 UTC
    Would this work in a windows environment?