Skip to content

Commit

Permalink
Fix log files not containing any newlines ever (affects FileHandler a…
Browse files Browse the repository at this point in the history
…nd RotatingFileHandler)
  • Loading branch information
aggieNick02 committed Sep 26, 2024
1 parent cf88c44 commit 66e3cfd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions adafruit_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def emit(self, record: LogRecord) -> None:
:param record: The record (message object) to be logged
"""
self.stream.write(self.format(record))
super().emit(record)
self.stream.flush()


Expand Down Expand Up @@ -431,9 +431,7 @@ def emit(self, record: LogRecord) -> None:
and (self._backupCount > 0)
):
self.doRollover()
self.stream.write(self.format(record))
self.stream.flush()

super().emit(record)

class NullHandler(Handler):
"""Provide an empty log handler.
Expand Down

0 comments on commit 66e3cfd

Please sign in to comment.