From 6d592794381af0e93338b272dce3f1262499db31 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 5 Aug 2025 13:56:17 -0400 Subject: [PATCH] statistics: Avoid adding extra blank spaces on empty stats reports Signed-off-by: Kevin O'Connor --- klippy/extras/statistics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/klippy/extras/statistics.py b/klippy/extras/statistics.py index 90cd53f8..9e6188a8 100644 --- a/klippy/extras/statistics.py +++ b/klippy/extras/statistics.py @@ -65,8 +65,8 @@ class PrinterStats: def generate_stats(self, eventtime): stats = [cb(eventtime) for cb in self.stats_cb] if max([s[0] for s in stats]): - logging.info("Stats %.1f: %s", eventtime, - ' '.join([s[1] for s in stats])) + stats_str = ' '.join([s[1] for s in stats if s[1]]) + logging.info("Stats %.1f: %s", eventtime, stats_str) return eventtime + 1. def load_config(config):