I use Twister to create a server. I also maintain a server error log. The problem is that if I allow the exception to be triggered before the stack, this will lead to the failure of the current connection and disconnection of the user, so, obviously, I attach the bare one except to capture everything else.
As soon as I caught something, is there a way to get the trace as a string so that I can store / print it somewhere myself without picking it up and letting Python print it for me after the program crashes?
source share