Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: When to use logging and why?

by AcidHawk (Vicar)
on Nov 13, 2003 at 09:38 UTC ( #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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2021-02-25 00:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?