Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Log Files Module

by kprasanna_79 (Hermit)
on Dec 28, 2005 at 17:22 UTC ( [id://519602]=note: print w/replies, xml ) Need Help??


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?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://519602]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-20 09:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found