good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I have recently started to use a different technique: all the Perl files in my application start with something like:
and the log statements read like: print LOG "blah" if( $trace{link_outpout});When I see a problem in the result (I am doing mostly batch processing here, so YMMV) I can then turn on whatever trace is needed. I find this very convenient, it allows me to focus on whatever area the problem seems to be in. Of course this could be improved by adding all and none fields to the trace hash, so I could write: print LOG "blah" if( $trace{all} or ($trace{link_outpout} and !$trace{none}));Or even better, write a function my_log:
I find this more flexible than just a numeric value, that inevitably ends up filling my log files with garbage. I guess just prefixing the log entry with the type of log and greping it could also work, but I like this way better because I can also use it when I am in debug mode under perl -d. In reply to Re: Determining debug levels
by mirod
|
|