Skip to content

Commit

Permalink
Add flush to the file write functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ilikecake committed Jun 3, 2024
1 parent f683fef commit 337770e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions adafruit_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -338,6 +339,7 @@ def emit(self, record: LogRecord) -> None:
):
self.doRollover()
self.stream.write(self.format(record))
self.stream.flush()


class NullHandler(Handler):
Expand Down

0 comments on commit 337770e

Please sign in to comment.