From 629ebdd794a8840fee22a51d594caa6bc5599d5b Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Mon, 1 Dec 2025 23:32:36 -0500 Subject: [PATCH] Fix --- esphome/platformio_api.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esphome/platformio_api.py b/esphome/platformio_api.py index 36779a8f8c..55807abc6a 100644 --- a/esphome/platformio_api.py +++ b/esphome/platformio_api.py @@ -114,11 +114,15 @@ FILTER_PLATFORMIO_LINES = [ class PlatformioLogFilter(logging.Filter): """Filter to suppress noisy platformio log messages.""" + _PATTERN = re.compile( + r"|".join(r"(?:" + pattern + r")" for pattern in FILTER_PLATFORMIO_LINES) + ) + def filter(self, record: logging.LogRecord) -> bool: # Only filter messages from platformio-related loggers if "platformio" not in record.name.lower(): return True - return not any(msg in record.getMessage() for msg in FILTER_PLATFORMIO_LINES) + return self._PATTERN.match(record.getMessage()) is None def patch_platformio_logging() -> None: