3 ms·
> @stacktrace/@traceable Somewhat more useful but, again, the logging module usually does this. Also, debuggers exist. While logging is good for production cod
by gknoy 4y ago
> @stacktrace/@traceable Somewhat more useful but, again, the logging module usually does this. Also, debuggers exist.
While logging is good for production code, the tracing helpers look very useful for developing or debugging. One of the first things I do when troubleshooting why something is failing (in tests, or when reproducing things locally where I can run things with a visible console) is to print out _what was passed in_, or what the mid-function state is, so that I don't have to constantly query them in the debugger. Many many lines that look like
print(f">>> foo: {foo}, bar: {bar}")
Being able to automate this in a more convenient way seems very useful. The icecream library [0] does this, probably in a more robust way, but I've never used it because I always forget about it.
0: https://github.com/gruns/icecream https://github.com/gruns/icecream