diff --git a/sphinx/util/logging.py b/sphinx/util/logging.py index e18d82469..d4d843e58 100644 --- a/sphinx/util/logging.py +++ b/sphinx/util/logging.py @@ -171,6 +171,11 @@ class MemoryHandler(logging.handlers.BufferingHandler): def shouldFlush(self, record: logging.LogRecord) -> bool: return False # never flush + def flush(self) -> None: + # suppress any flushes triggered by importing packages that flush + # all handlers at initialization time + pass + def flushTo(self, logger: logging.Logger) -> None: self.acquire() try: