* refactor: add create_handler alongside create_logger * fix: bench helper click exceptions for --help (2nd attempt) * fix: increase logging level missing test records * fix: reorganize test runner into testing module and refine logging * fix: semgrep complaint * chore: remove unused code; only keep deprecation proxies * fix: import statements * fix: output & string processing
17 lines
373 B
Python
17 lines
373 B
Python
import logging
|
|
import time
|
|
from functools import wraps
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def debug_timer(func):
|
|
@wraps(func)
|
|
def wrapper(*args, **kwargs):
|
|
start_time = time.monotonic()
|
|
result = func(*args, **kwargs)
|
|
end_time = time.monotonic()
|
|
logger.debug(f" {func.__name__:<50} ⌛{end_time - start_time:>6.3f} seconds")
|
|
return result
|
|
|
|
return wrapper
|