diff --git a/logging/logging.py b/logging/logging.py index 0e1b7f04..cea2de03 100644 --- a/logging/logging.py +++ b/logging/logging.py @@ -59,6 +59,13 @@ class Logger: def critical(self, msg, *args): self.log(CRITICAL, msg, *args) + def exc(self, e, msg, *args): + self.log(ERROR, msg, *args) + sys.print_exception(e, _stream) + + def exception(self, msg, *args): + self.exc(sys.exc_info()[1], msg, *args) + _level = INFO _loggers = {}