3 ms·
Sometimes the logging is not enough, and you cannot isolate the case to prepare appropriate unit test. Just few days ago I had a strange problem with the order
by Xion 14y ago
Sometimes the logging is not enough, and you cannot isolate the case to prepare appropriate unit test.
Just few days ago I had a strange problem with the order of imports in Python at the border of my code and external library (Celery). There were import hooks involved but they didn't seem to be executed properly in certain conditions. I could reproduce them quite reliably but I needed to pinpoint the exact import (inside Celery itself, mind you) that was causing the problem. pdb (Python debugger) was indispensable while solving it.
On the other hand, though, it was probably the first time in many months that I used pdb for more than 5 minutes, and for something more complicated than checking why a particular test fails.
- lifeisstillgood 14y agoThats my experience as well - I rarely use a debugger, but when I do I cannot imagine any other way of finding out what is going on.
- StavrosK 14y agoI agree, you certainly have to trace execution flow somehow, and a debugger is the best way to do that. However, my realization was more that the debugger wasn't useful for the vast majority of cases. Until now, I somehow thought I used a debugger a lot, and that it was a big part of my debugging (after all, how do you debug without a debugger?). This post made me realize that 95% of the time I fix errors from just the stack trace, 4.9% from logging, and 0.1% from actually debugging.