Skip to content

Commit 842dcbb

Browse files
committed
Include the previous changes made to _default_name
See: hardbyte#1383
1 parent ce815d6 commit 842dcbb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

can/io/logger.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,12 @@ def _default_name(self) -> StringPathLike:
406406
"""Generate the default rotation filename."""
407407
path = pathlib.Path(self.base_filename)
408408
new_name = (
409-
path.stem
410-
+ "_"
411-
+ datetime.now().strftime("%Y-%m-%dT%H%M%S")
412-
+ "_"
413-
+ f"#{self.rollover_count:03}"
414-
+ path.suffix
409+
path.stem.split(".")[0]
410+
+ "_"
411+
+ datetime.now().strftime("%Y-%m-%dT%H%M%S")
412+
+ "_"
413+
+ f"#{self.rollover_count:03}"
414+
+ "".join(path.suffixes[-2:])
415415
)
416416
return str(path.parent / new_name)
417417

0 commit comments

Comments
 (0)