From 337770e62bd250e8af777e8e9f703fee7ac862f9 Mon Sep 17 00:00:00 2001 From: Pat Date: Sun, 2 Jun 2024 22:18:58 -0500 Subject: [PATCH] Add flush to the file write functions --- adafruit_logging.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/adafruit_logging.py b/adafruit_logging.py index 370f252..fc552d7 100644 --- a/adafruit_logging.py +++ b/adafruit_logging.py @@ -239,6 +239,7 @@ def emit(self, record: LogRecord) -> None: :param record: The record (message object) to be logged """ self.stream.write(self.format(record)) + self.stream.flush() class RotatingFileHandler(FileHandler): @@ -338,6 +339,7 @@ def emit(self, record: LogRecord) -> None: ): self.doRollover() self.stream.write(self.format(record)) + self.stream.flush() class NullHandler(Handler):