Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: When to use logging and why?

by AcidHawk (Vicar)
on Nov 13, 2003 at 09:38 UTC ( [id://306748]=note: print w/replies, xml ) Need Help??

in reply to When to use logging and why?

As liz and pg have already said reporting and debugging. But I also often need to run my scripts as daemons/services and can't see any output so need to see what is going on (Debugging). Also though, I need to run external programs with command line args which I have got from somewhere else (wrapper type things) I often do something as follows;

my $cmd = "extern_prog.exe -$myarg1 -$myarg2 -$myarg3"; if ($DEBUG >= 9) { &Update_Log($cmd); } `$cmd`; sub Update_Log { my $msg = shift; #write $msg to logfile ... }
type stuff, This lets me copy the exact command out of the log file (with the parameters I added) and run it from the command line to check if I have gotten any funny (un-expected) results. You will not believe how many times I have used this..

Of all the things I've lost in my life, its my mind I miss the most.

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-07-24 21:34 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.