[output] add 'Logger.traceback()' helper

This commit is contained in:
Mike Fährmann
2025-10-14 18:44:29 +02:00
parent 9d054ad18d
commit 8c62be343e
15 changed files with 33 additions and 27 deletions

View File

@@ -89,6 +89,11 @@ class LoggerAdapter():
self.logger = logger
self.extra = job._logger_extra
def traceback(self, exc):
if self.logger.isEnabledFor(logging.DEBUG):
self.logger._log(
logging.DEBUG, "", None, exc_info=exc, extra=self.extra)
def debug(self, msg, *args, **kwargs):
if self.logger.isEnabledFor(logging.DEBUG):
kwargs["extra"] = self.extra