Skip to content

Commit c39719c

Browse files
author
j-c-cook
committed
Control BLFWriter max container size
1 parent 87ecc64 commit c39719c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

can/io/logger.py

+6
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,12 @@ def __init__(
325325
self.base_filename = os.path.abspath(base_filename)
326326
self.max_bytes = max_bytes
327327

328+
# BLFWriter specific
329+
_128_kb = 128 * 1024
330+
if kwargs.get('max_container_size', 1) and max_bytes > 0:
331+
kwargs['max_container_size'] = \
332+
_128_kb if max_bytes > _128_kb else max_bytes * 0.1
333+
328334
self._writer = self._get_new_writer(self.base_filename)
329335

330336
def should_rollover(self, msg: Message) -> bool:

0 commit comments

Comments
 (0)