From 4f0bfbc695fe926fbc759a3f8440136abfe53d1a Mon Sep 17 00:00:00 2001 From: Jeff Culverhouse Date: Tue, 18 Aug 2026 12:13:16 -0400 Subject: [PATCH] Fix missing logger argument in cpu_stats error message The _LOGGER.error() call logging the raw cpu_stats payload uses a three-placeholder format string but passes only two arguments, omitting self._instance. Every sibling call in this except block passes (self._instance, self._name, ...). When the KeyError path is hit, logging raises 'TypeError: not enough arguments for format string' internally, so instead of one diagnostic line the user gets '--- Logging error ---' plus two tracebacks and a full call stack. --- custom_components/monitor_docker/helpers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/monitor_docker/helpers.py b/custom_components/monitor_docker/helpers.py index b0aad80..7204684 100644 --- a/custom_components/monitor_docker/helpers.py +++ b/custom_components/monitor_docker/helpers.py @@ -1209,7 +1209,10 @@ async def _run_container_stats(self) -> None: ) if "cpu_stats" in raw: _LOGGER.error( - "[%s] %s: Raw 'cpu_stats' %s", self._name, raw["cpu_stats"] + "[%s] %s: Raw 'cpu_stats' %s", + self._instance, + self._name, + raw["cpu_stats"], ) else: _LOGGER.error(