Skip to content

Commit

Permalink
Merge pull request #9772 from gibsondan/loggingflush
Browse files Browse the repository at this point in the history
Closes #9733: Fix for logging handler flushing warnings in the middle of the docs build
  • Loading branch information
tk0miya committed Oct 30, 2021
2 parents 2b5c55e + b1c0d1f commit 745e114
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sphinx/util/logging.py
Expand Up @@ -171,6 +171,11 @@ def __init__(self) -> None:
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:
Expand Down

0 comments on commit 745e114

Please sign in to comment.