mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
cli: Don't double print uncaught exceptions with --debug
We have an excepthook that logs uncaught exceptions for good reason, but if printing --debug to stdout this exception gets printed twice when we invoke the stock __excepthook__. Skip that in the debug_stdout case.
This commit is contained in:
parent
2f0e730efc
commit
6969066b9f
@ -256,6 +256,9 @@ def setupLogging(appname, debug_stdout, do_quiet, cli_app=True):
|
||||
def exception_log(typ, val, tb):
|
||||
logging.debug("Uncaught exception:\n%s",
|
||||
"".join(traceback.format_exception(typ, val, tb)))
|
||||
if not debug_stdout:
|
||||
# If we are already logging to stdout, don't double print
|
||||
# the backtrace
|
||||
sys.__excepthook__(typ, val, tb)
|
||||
sys.excepthook = exception_log
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user