From 3eea4bbaf6a4cacffad6f64615db8592f111c531 Mon Sep 17 00:00:00 2001 From: jaknapper Date: Tue, 13 May 2025 17:08:09 +0100 Subject: [PATCH] Log each line individually to ensure line breaks --- src/openflexure_microscope_server/things/smart_scan.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/openflexure_microscope_server/things/smart_scan.py b/src/openflexure_microscope_server/things/smart_scan.py index 819a1a3b..51b56e24 100644 --- a/src/openflexure_microscope_server/things/smart_scan.py +++ b/src/openflexure_microscope_server/things/smart_scan.py @@ -965,12 +965,9 @@ class SmartScanThing(Thing): def log_buffer(buffer): """A short internal function to read everything in the buffer to - a multiline string and log""" - lines = [] + the log""" while line := buffer.readline(): - lines.append(line) - if lines: - logger.info("".join(lines)) + logger.info(line) # Run the command piping stdout into the process for reading and # forwarding the stdrerr to stdout