Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8bb518a

Browse files
committedJul 10, 2024·
Merge branch 'feature/flush-logs' into testing
2 parents e05987f + 0b6c460 commit 8bb518a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎runusb/__main__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,9 @@ def _setup_logging(self, log_dir: str) -> None:
346346
os.path.join(log_dir, LOG_NAME),
347347
mode='w', # Overwrite the log file
348348
)
349+
# Write through to avoid buffering the log file since the USB might be
350+
# removed at any time
351+
self.handler.stream.reconfigure(write_through=True)
349352
REL_TIME_FILTER.reset_time_reference() # type: ignore[union-attr]
350353
self.handler.setFormatter(TieredFormatter(
351354
fmt='[%(reltime)08.3f - %(levelname)s] %(message)s',

0 commit comments

Comments
 (0)
Please sign in to comment.