Skip to content

Commit 8736a56

Browse files
alexfiklinducer
authored andcommitted
feat: improve log_process description
1 parent 7726dee commit 8736a56

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pytools/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2872,10 +2872,15 @@ def __init__(self,
28722872
self.long_threshold_seconds = long_threshold_seconds
28732873

28742874
def __call__(self, wrapped: Callable[P, R]) -> Callable[P, R]:
2875+
if self.description:
2876+
description = f"{wrapped.__qualname__} ({self.description})"
2877+
else:
2878+
description = wrapped.__qualname__
2879+
28752880
def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
28762881
with ProcessLogger(
28772882
self.logger,
2878-
self.description or wrapped.__name__,
2883+
description,
28792884
long_threshold_seconds=self.long_threshold_seconds):
28802885
return wrapped(*args, **kwargs)
28812886

0 commit comments

Comments
 (0)