Regarding the need for extra flexibility in your debug statements indicating a serious wrongness in your code. Well, yes, um, ah, sure. I would hope that your debugging statements would help with serious problems in your code. That is the point isn't it. Flexibility, here, is a good thing. The convenience of getting just the pertinent info at the cost of being limited to, likely, 32 debug levels is a good trade. Not that I expect anyone to start refactoring. Just mentioning a refinement.
The distinction you make between debugging output and logging is fuzzy to me. Here we are skirting one of my questions: What are the trade-offs between having a module contain its debugging code versus depending upon another module?
I have found the lack of debugging statements in my code to be unsettling at times. To know that I instrumented the code and promptly deleted it three years ago only distracts from the task of understanding the code again.
Tracing, pre-, post-conditions, some other assertions are all debugging statements to keep. Others may just be noise. I'm going to apply my rule two paragraph 4 and experiment with keeping them all. It should not be too cluttering because it will be my clutter and it had some, my, motive to exist. This will be a long experiment.
Thanks for the Hook::LexWrap reference.
In reply to Re: Re^3: Instrumenting code for debugging.
by rir
in thread Instrumenting code for debugging.
by rir
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |