[FYI][all] PySnooper, a poor man's debugger

Artom Lifshitz alifshit at redhat.com
Mon Apr 22 13:32:51 UTC 2019


tl;dr Instead of debugging with LOG.debug and/or print() statements
all over the place, use the pysnooper decorator [1].

I came across this on Hacker News this morning - if you're like me and
are too lazy to invest in learning a real debugger, and instead do it
with LOG.debug/print()s all over the place, pysnooper might be useful
to you. This line from the README feels particularly relevant to me ;)

> What makes PySnooper stand out from all other code intelligence tools?
> You can use it in your sh***y, sprawling enterprise codebase without having
> to do any setup.

I tried it out with a random Nova unit test by decorating the function
being tested, and it gave me the expected analysis of how the function
executed.

Just sharing this, I hope it might be useful to someone :)

[1] https://github.com/cool-RR/pysnooper



More information about the openstack-discuss mailing list