Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion can/io/blf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import datetime
import time
import logging
from typing import List, BinaryIO, Generator, Union, Tuple, Optional, cast
from typing import List, BinaryIO, Generator, Union, Tuple, Optional, cast, Any

from ..message import Message
from ..util import len2dlc, dlc2len, channel2int
Expand Down Expand Up @@ -370,6 +370,8 @@ def __init__(
append: bool = False,
channel: int = 1,
compression_level: int = -1,
*args: Any,
**kwargs: Any
) -> None:
"""
:param file: a path-like object or as file-like object to write to
Expand Down Expand Up @@ -400,6 +402,9 @@ def __init__(
self.compression_level = compression_level
self._buffer: List[bytes] = []
self._buffer_size = 0
# If max container size is located in kwargs, then update the instance
if kwargs.get("max_container_size", False):
self.max_container_size = kwargs["max_container_size"]
if append:
# Parse file header
data = self.file.read(FILE_HEADER_STRUCT.size)
Expand Down
5 changes: 3 additions & 2 deletions can/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,9 @@ def main() -> None:
"--file_size",
dest="file_size",
type=int,
help="Maximum file size in bytes. Rotate log file when size threshold "
"is reached.",
help="Maximum file size in bytes (or for the case of blf, maximum "
"buffer size before compression and flush to file). Rotate log "
"file when size threshold is reached.",
default=None,
)

Expand Down