from functools import wraps
deflogit(func):@wraps(func)defwith_logging(*args, **kwargs):
print(func.__name__ + " was called")
return func(*args, **kwargs)
return with_logging
@logitdefaddition_func(x):"""Do some math."""return x + x
result = addition_func(4)
# Output: addition_func was called