Presentation slides
https://slides.com/invisibleroads/debugging-tips
Demonstration video
Extended notes
1. Examine exception while running interpreter
jupyter notebook
debug
2. Pinpoint variables in scope
import IPython; IPython.embed()
whos
3. Step through execution at breakpoint
import pudb; pudb.set_trace()
4. Drop into debugger without modifying code
pudb -- xyz.py arg1 arg2
5. Trace on CTRL-C
import pudb; pudb.set_interrupt_handler()
6. Debug threads or Docker containers
import wdb; wdb.set_trace()
7. Use namespaced logger with rsyslog server
logging.getLogger(__name__)
8. Debug tests
pip install pdbpp; py.test --pdb