No such thing as a small change | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
> A good idea, I was hoping for something even cleaner, that won't show up in production code by mistake.
It doesn't look like you will pass any arguments to log(), caller seems to provide anything you are looking for. If you later check for production environment and set then it will be optimized and not appear in the opcodes. If you are still worried, use a name you can easily find and delete, like __LOG__, even a source filter doing this should be very safe.¹ But please search the archives for older discussions, this is certainly not the first one.
Cheers Rolf
UPDATE¹) or even better, use Damian's approach from Smart::Comments and use a source filter only in testing mode to enable log() by deleting the '#' with s/;#LOG/;LOG;/g
In reply to Re^5: Module for Printing Line Numbers in Debug?
by LanX
|
|