gstAutotest/extra.py
Artur Mukhamadiev 8b9190bb86 [init] just move from pipelines repo
:Release Notes:
-

:Detailed Notes:
-

:Testing Performed:
-

:QA Notes:
-

:Issues Addressed:
-
2025-10-11 18:41:28 +03:00

17 lines
574 B
Python

from functools import wraps
def log_args_decorator(func):
"""
A decorator that logs the arguments passed to a function.
"""
@wraps(func)
def wrapper(*args, **kwargs):
arg_names = func.__code__.co_varnames[:func.__code__.co_argcount]
pos_args = dict(zip(arg_names, args))
all_args = {**pos_args, **kwargs}
print(f"Calling function '{func.__name__}' with arguments: {all_args}")
result = func(*args, **kwargs)
print(f"Function '{func.__name__}' returned: {result}")
return result
return wrapper