functions: print a nicer traceback

This commit is contained in:
alfrix 2022-11-25 09:04:17 -03:00
parent b5cf73054a
commit 8297f72ff4

View File

@ -177,7 +177,7 @@ def setup_logging(log_file, software_version):
def logging_exception_handler(ex_type, value, tb, thread_identifier=None):
logging.exception(
f'Uncaught exception {ex_type}: {value}\n'
f'Traceback: {traceback.format_tb(tb)}'
+ '\n'.join([str(x) for x in [*traceback.format_tb(tb)]])
)
sys.excepthook = logging_exception_handler