Skip to content

Commit cf9e53b

Browse files
committed
🐛 Fix: Adjust sign handling in timedelta formatting and improve DynamicIndentFormatter initialization
1 parent b81a6fb commit cf9e53b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/pytest-simcore/src/pytest_simcore/helpers/logging_tools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def _timedelta_as_minute_second_ms(delta: datetime.timedelta) -> str:
2222
if int(milliseconds * 1000) != 0:
2323
result += f"{int(milliseconds*1000)}ms"
2424

25-
sign = "-" if total_seconds < 0 else ""
25+
sign = "-" if total_seconds < 0 else "<1ms"
2626

2727
return f"{sign}{result.strip()}"
2828

@@ -32,10 +32,10 @@ class DynamicIndentFormatter(logging.Formatter):
3232
_cls_indent_level: int = 0
3333
_instance_indent_level: int = 0
3434

35-
def __init__(self, fmt=None, datefmt=None, style="%"):
35+
def __init__(self, fmt: str | None = None, *args, **kwargs):
3636
dynamic_fmt = fmt or "%(asctime)s %(levelname)s %(message)s"
3737
assert "message" in dynamic_fmt
38-
super().__init__(dynamic_fmt, datefmt, style)
38+
super().__init__(dynamic_fmt, *args, **kwargs)
3939

4040
def format(self, record) -> str:
4141
original_message = record.msg

0 commit comments

Comments
 (0)