diff --git a/rich/logging.py b/rich/logging.py index b2624cd54..4f751fd2b 100644 --- a/rich/logging.py +++ b/rich/logging.py @@ -131,7 +131,11 @@ def get_level_text(self, record: LogRecord) -> Text: def emit(self, record: LogRecord) -> None: """Invoked by logging.""" - message = self.format(record) + try: + message = self.format(record) + except Exception: + self.handleError(record) + traceback = None if ( self.rich_tracebacks