in reply to Debugging in packages
A better approach IMHO is to have a centralized messaging/logging/debugging method or function that takes a message and a priority number, and use that in your code instead of calling print().
Then you can set the debugging level (e.g., with an environment variable, or a configuration option, or even just an option or an argument), and if the current debugging level exceeds or is equal to the priority number of a message, the message will be printed to STDERR, or logged to a file, or whatever.
Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com
|
---|
Replies are listed 'Best First'. | |
---|---|
($code or die) Re: Debugging in packages
by $code or die (Deacon) on Jul 17, 2001 at 18:15 UTC | |
by clemburg (Curate) on Jul 17, 2001 at 18:23 UTC |