Logger messages (#818)

* Change the way logger messages are generated by using the printf-like method
* Use single quotes around log values that can be empty strings
* Fix bug in log message
This commit is contained in:
Veronica Berglyd Olsen
2021-07-02 10:22:00 +02:00
committed by GitHub
parent 671888b6ea
commit 1b89d0a4f0
20 changed files with 219 additions and 219 deletions
+2 -2
View File
@@ -43,7 +43,7 @@ def logException():
"""Log the content of an exception message.
"""
exType, exValue, _ = sys.exc_info()
logger.error("%s: %s" % (exType.__name__, str(exValue).strip("'")))
logger.error("%s: %s", exType.__name__, str(exValue).strip("'"))
# =============================================================================================== #
@@ -159,7 +159,7 @@ def exceptionHandler(exType, exValue, exTrace):
from traceback import print_tb
from PyQt5.QtWidgets import qApp
logger.critical("%s: %s" % (exType.__name__, str(exValue)))
logger.critical("%s: %s", exType.__name__, str(exValue))
print_tb(exTrace)
try: