3 ms·
For one, I think repr is more fit. And if repr (or str) has a bug, now you are chasing two issues! Besides, repr (or str) may take a lot of processing time and
by aurelianito 12y ago
For one, I think repr is more fit.
And if repr (or str) has a bug, now you are chasing two issues! Besides, repr (or str) may take a lot of processing time and it is not unusual to log an exception stack trace but keep running.
At last, if you are going to debug, a lot of times is better to use a debugger instead of putting print (or log) statements all around. I prefer pydev for this. You can even attach to a python process running as a different user or even on a different computer.
I documented how to do it in a post on my blog (sorry, in Spanish). http://aurelianito.blogspot.com.ar/2013/05/debugueando-en-root-con-pydev.html http://aurelianito.blogspot.com.ar/2013/05/debugueando-en-ro...
- StavrosK 12y agoIf you prefer the console, pudb is an absolutely fantastic curses debugger. I love it.