You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently an unhandled exception just shows the standard plain Python traceback. It can be helpful for debugging to show more information, and the dependencies are already there. One method is this:
However this doesn't work on its own, and a helpful warning explains why:
/code/.venv/lib/python3.10/site-packages/structlog/dev.py:421: UserWarning: Remove `format_exc_info` from your processor chain if you want pretty exceptions.
Indeed, removing that processor gives nice rich tracebacks:
I'm not familiar with structlog, maybe there's a better official way to do this. I also don't know the motivation for having format_exc_info and the consequences of removing it.
An alternative, more direct approach:
rich.traceback.install(show_locals=True)
This has pretty much the same effect, but it's not logging, and maybe that's a problem.
None of this should be the default behaviour as the tracebacks are huge and annoying when you don't want them, but maybe it could be enabled by a new env var in settings.py or some kind of verbose/debug CLI argument.
The text was updated successfully, but these errors were encountered:
We're not actually using the structured logging for anything, so this is probably the way to go. I'll determine priority next week once the upcoming ICE release is done.
Currently an unhandled exception just shows the standard plain Python traceback. It can be helpful for debugging to show more information, and the dependencies are already there. One method is this:
However this doesn't work on its own, and a helpful warning explains why:
Indeed, removing that processor gives nice rich tracebacks:
I'm not familiar with structlog, maybe there's a better official way to do this. I also don't know the motivation for having
format_exc_info
and the consequences of removing it.An alternative, more direct approach:
This has pretty much the same effect, but it's not logging, and maybe that's a problem.
None of this should be the default behaviour as the tracebacks are huge and annoying when you don't want them, but maybe it could be enabled by a new env var in
settings.py
or some kind of verbose/debug CLI argument.The text was updated successfully, but these errors were encountered: