testing: Add TEST_LOG_IGNORE_ERRORS envvar to suppress logging errors

This commit is contained in:
Christian Decker
2026-01-14 14:58:06 +01:00
committed by Rusty Russell
parent d03cf820a8
commit 49049deb82

View File

@@ -59,6 +59,9 @@ def setup_logging():
if TEST_DEBUG:
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)
if env("TEST_LOG_IGNORE_ERRORS", "0") == "1":
logging.raiseExceptions = False
yield
loggers = [logging.getLogger()] + list(logging.Logger.manager.loggerDict.values())