tracing
tracing copied to clipboard
Trace events on panic
Trace events on panic
Motivation
I write dynamicaly linked library that encounters panic caused by multiple things (like mistakes or invalid data coming from outside of crate). stacktrace appear only in console window (if shows), and log contains no information about it. Right now people needs to copy paste the console window before it close to be able to provide useful bug report. It would be great if the stacktrace would be in the file with rest of the log.
Proposal
Emit tracing even with maximum severity when panic happen.
Only thing that I am aware of that could be a problem for you is case when the panic will be caused by tracing itself. I think it will then probably crash with stack owerflow or something. I have no idea how that can be prevented, but on the other hand it should not be a common issue.
Alternatives
Each user would register own global panic handler, and emit tracing event manually. That does not sound as bad idea either, but I tried and it did not end in the file, so example how to do it correctly would be appreciated.