fixed error text display

This commit is contained in:
vicky 2022-05-17 18:02:59 +02:00
parent a03262a3fd
commit 03be9cbba4
1 changed files with 2 additions and 2 deletions

View File

@ -61,8 +61,8 @@ def log_exception(exception, level="ERROR"):
"""
level = level.lower()
logging.__getattribute__(level)(traceback.format_exc())
for line in exception.__str__():
logging.__getattribute__(level)(line)
for line in exception.__str__()[1:-1].split('\\n'):
logging.__getattribute__(level)(' ' + line)
if level in ["critical", "error"]:
print("An unrecoverable error occurred, please check the log file for more information.")
sys.exit() # could also re-raise the exception