From 66e57953ca114dc0d979cfa0b2531aba4b28cb10 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Wed, 5 Nov 2025 10:44:43 +0200 Subject: [PATCH] feat: improve log_process description --- pytools/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pytools/__init__.py b/pytools/__init__.py index 796b3a23..b9d4f27f 100644 --- a/pytools/__init__.py +++ b/pytools/__init__.py @@ -2872,10 +2872,15 @@ def __init__(self, self.long_threshold_seconds = long_threshold_seconds def __call__(self, wrapped: Callable[P, R]) -> Callable[P, R]: + if self.description: + description = f"{wrapped.__qualname__} ({self.description})" + else: + description = wrapped.__qualname__ + def wrapper(*args: P.args, **kwargs: P.kwargs) -> R: with ProcessLogger( self.logger, - self.description or wrapped.__name__, + description, long_threshold_seconds=self.long_threshold_seconds): return wrapped(*args, **kwargs)