Skip to content

Commit 977e1e0

Browse files
author
jack-cook_agco
committed
Add print statements to highlight the bug
1 parent b9d9d01 commit 977e1e0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

can/io/blf.py

+1
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ def _add_object(self, obj_type, data, timestamp=None):
531531
self._buffer_size += obj_size + padding_size
532532
self.object_count += 1
533533
if self._buffer_size >= self.max_container_size:
534+
print("Flush the buffer to a file. Larger than max container!")
534535
self._flush()
535536

536537
def _flush(self):

can/io/logger.py

+7
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,14 @@ def should_rollover(self, msg: Message) -> bool:
325325
if self.max_bytes <= 0:
326326
return False
327327

328+
value = self.writer.file.tell()
329+
330+
if value != 144:
331+
print("NOT 144!")
332+
328333
if self.writer.file.tell() >= self.max_bytes:
334+
print('Rollover: {} bytes'.format(value))
335+
print('Buffer size: {} bytes'.format(self._writer._buffer_size))
329336
return True
330337

331338
return False

0 commit comments

Comments
 (0)