--- a/ui.py Sun Jan 21 18:32:14 2018 +0000 +++ b/ui.py Sun Jan 21 21:32:48 2018 +0000 @@ -1,5 +1,5 @@ # -# MacOS UI +# Borgend MacOS UI # import rumps @@ -7,6 +7,7 @@ import datetime import logging import borgend +import utils from threading import Lock, Timer from config import settings import objc @@ -42,7 +43,8 @@ rumps.notification(title, subtitle, message, data=d) except Exception as err: - logger.debug('Unable to display notificaton:%s:%s',err.__class__.__name__, str(err)) + utils.log_exception(logger, err, + detail='Unable to display notification') # Based on code snatched from # https://stackoverflow.com/questions/12523586/python-format-size-application-converting-b-to-kb-mb-gb-tb/37423778 @@ -211,8 +213,7 @@ try: b.create(None) except Exception as err: - logger.debug("Opening notification for exception %s '%s'", - err.__class__.__name__, str(err)) + utils.log_exception(logger, err) notification_workaround(borgend.appname_stylised, err.__class__.__name__, str(err)) @@ -233,5 +234,5 @@ # Does not return until closed self.logwindow=None except Exception as err: - logger.critical('%s:%s', err.__class__.__name__, str(err)) + utils.log_exception(logger, err)