Comment by Tepix

Comment by Tepix 6 days ago

2 replies

My first rule for debugging debutants:

Don't be too embarassed to scatter debug logmessages in the code. It helps.

My second rule:

Don't forget to remove them when you're done.

lanstin 6 days ago

My rule for a long time has been anytime I add a print or log, except for the first time I am writing some new cide with tricky logic, which I try not to do, never delete it. Lower it to the lowest possible debug or trace level but if it was useful once it will be useful again, even if only to document the flow thru the code on full debug.

The nicest log package I had would always count the number of times a log msg was hit even if the debug level meant nothing happened. The C preprocessor made this easy, haven't been able to get a short way to do this counting efficiently in other languages.