Just another Perl shrine | |
PerlMonks |
Creating a comprehensive log fileby juo (Curate) |
on Dec 16, 2004 at 02:05 UTC ( [id://415266]=perlquestion: print w/replies, xml ) | Need Help?? |
juo has asked for the wisdom of the Perl Monks concerning the following question: Hello, I wonder if anybody had any good suggestions to create a comphrehensive log file when running scripts. The log file should contain printed lines send to it but also contain all the warnings and errors from the STDOUT. Is their a good way to do this besides from re-directing my STDOUT in the beginning of a script direclty to a filehandle.
I don't want to remove my STDOUT, I just want in parallel capture it in a log file. The result could be something like this
So instead of having all the time an open filehandle is their another way to just capture when something goes to the STDOUT and then write this into a file. For the print I think I can do this easily with the following subroutine but I don't have an idea to also re-direct STDOUT errors and warnings to that routine
Back to
Seekers of Perl Wisdom
|
|