I run a medium-sized django project, whenever an error occurs, a trace is printed, but there are many functions where the Django modules are.
But the actual culprit in my own project code, it has only one line, and the useful context was hidden due to the limited trace depth. So I'm thinking of filtering the call stack along the module path instead of the call depth.
If you have not seen this problem, I have a very similar example in Java . I need the business logic code to display in advance in the exception.
So far I know traceback.print_exc(), but you need to wrap each code in try ... except.
Is it possible to change the default trace behavior of python by default so that the django call stack is smaller and my own code is most?
source
share