Add default to item_older_than_n_days.
[kiosk.git] / decorators.py
1 #!/usr/bin/env python3
2
3 import functools
4 import logging
5
6
7 logger = logging.getLogger(__name__)
8
9
10 def invocation_logged(func):
11     @functools.wraps(func)
12     def wrapper(*args, **kwargs):
13         logger.debug(f"Entered {func.__qualname__}")
14         ret = func(*args, **kwargs)
15         logger.debug(f"Exited {func.__qualname__}")
16         return ret
17
18     return wrapper
19
20
21 # Test
22 # @invocation_logged
23 # def f(x):
24 #    print(x * x)
25 #    return x * x
26 #
27 # q = f(10)
28 # print(q)