testing: Add TEST_LOG_IGNORE_ERRORS envvar to suppress logging errors
What changed, and why it matters
This commit adds a testing-only environment variable that, when enabled, tells Python's logging system not to raise exceptions if something goes wrong while formatting or emitting log messages. It only affects the project's internal Python test harness and has no bearing on real Lightning node operation, funds, network security, or production code.
No security action required. Treat as a normal test-infrastructure quality-of-life change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch introduces TEST_LOG_IGNORE_ERRORS in contrib/pyln-testing/pyln/testing/fixtures.py. When set to ‘1’, it assigns logging.raiseExceptions = False. This is a pytest fixture helper used during automated tests; it does not change Core Lightning daemon behavior, cryptography, protocol handling, or wallet logic.
Changed components
contrib/pyln-testing/pyln/testing/fixtures.pyInspect captured patch +3 / −0
diff --git a/contrib/pyln-testing/pyln/testing/fixtures.py b/contrib/pyln-testing/pyln/testing/fixtures.py
index 5a439677..c5015ed3 100644
--- a/contrib/pyln-testing/pyln/testing/fixtures.py
+++ b/contrib/pyln-testing/pyln/testing/fixtures.py
@@ -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())
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.