From 7b7c5f932e50c06aa261da79108ee67f28a8ec4c Mon Sep 17 00:00:00 2001 From: Joe Knapper Date: Wed, 8 Jul 2026 14:05:01 +0100 Subject: [PATCH] Convert log to string for fallback server --- src/openflexure_microscope_server/server/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/openflexure_microscope_server/server/__init__.py b/src/openflexure_microscope_server/server/__init__.py index 2e1849bf..e9fa24bd 100644 --- a/src/openflexure_microscope_server/server/__init__.py +++ b/src/openflexure_microscope_server/server/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations +import json import logging import os from argparse import Namespace @@ -150,7 +151,8 @@ def serve_from_cli(argv: Optional[list[str]] = None) -> None: print(f"Error: {e}") # noqa: T201 print("Starting fallback server.") # noqa: T201 try: - log_history = OFM_HANDLER.log_history + # The log is a list of dicts, fallback server expects a string + log_history = json.dumps(OFM_HANDLER.log_history, indent=2) except BaseException: # If log history fails for any reason carry on. log_history = None