all repos — listfix @ c75eb41aa6a40e13bdcdc38a111128452c3c633e

Postfix Mailing List Software; Maintained on behalf the of Agency Economy Incorporated NFP.

Add logging to error module.

	modified:   listfix/errors.py
Brian Barto bartobrian@gmail.com
Fri, 01 Apr 2022 16:10:35 -0400
commit

c75eb41aa6a40e13bdcdc38a111128452c3c633e

parent

b61c76044a547c3b44bc4a660adbb6c038980f09

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M listfix/errors.pylistfix/errors.py

@@ -1,16 +1,19 @@

import sys +from .log import Log class Errors: def __init__(self, debug=False): self.debug = debug self._exception_handler = None + self.log = Log() def set_exception_handler(self): self._exception_handler = sys.excepthook sys.excepthook = self.exception_handler def exception_handler(self, exception_type, exception, traceback): + self.log.error(f"{exception_type.__name__}, {exception}") if (self.debug): self._exception_handler(exception_type, exception, traceback) else: