Closed guyskk closed 6 years ago
Logging integration:
class TbVaccineFormatter(logging.Formatter):
def formatException(self, exc_info):
return TBVaccine(isolate=True).format_exc()
sh = logging.StreamHandler()
sh.setFormatter(TbVaccineFormatter('[%(levelname)s] %(asctime)s : %(message)s', '%Y-%m-%d %H:%M:%S'))
logger.addHandler(sh)
Thank you, @afeblot. Would you mind issuing a PR to add that to the README? It's very useful.
It no effect when exception raised in flask request because the tracebacks are formatted by logging, the
sys.excepthook
is not called.eg:
the outputs: