From 00ac853488183a833dd1500032d6786daa02632e Mon Sep 17 00:00:00 2001 From: avollkopf <43980694+avollkopf@users.noreply.github.com> Date: Wed, 1 May 2024 19:55:29 +0200 Subject: [PATCH] write logfile line by line --- cbpi/controller/system_controller.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cbpi/controller/system_controller.py b/cbpi/controller/system_controller.py index 70c804a..89387fc 100644 --- a/cbpi/controller/system_controller.py +++ b/cbpi/controller/system_controller.py @@ -157,15 +157,14 @@ class SystemController: j.seek_realtime(since) for entry in j: result.append(entry['MESSAGE']) - logging.error(result) try: with open(fullname, 'w') as f: - f.write(result) + for line in result: + f.write(f"{line}\n") except Exception as e: logging.error(e) plugins = await self.plugins_list() - with open(fullpluginname, 'w') as f: f.write(plugins)