Add some basic logging to the application. Also for severe errors, track them in info.log file in local folder

This commit is contained in:
Alessandro
2020-04-11 15:27:05 +02:00
parent ab32fbbf98
commit eaeb51de65
10 changed files with 86 additions and 20 deletions

View File

@@ -1,3 +1,4 @@
import logging
import subprocess as sp
import webbrowser
from PyQt5.QtCore import QObject, pyqtSlot, QProcess
@@ -99,6 +100,7 @@ class UpdatesController(QObject):
try:
updater.startDetached(command)
except BaseException:
logging.error("Unable to start updater")
pass
else:
qApp.quit()
@@ -122,6 +124,7 @@ class UpdatesController(QObject):
) as proc:
updater_version = proc.stdout.read().rstrip("\r\n") # Strip any possible newline, to be sure.
except Exception:
logging.error("Unable to query the updater")
updater_version = latest_updater_version
if latest_updater_version is None:
return