X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=decorators.py;h=9995bd67ecae0479fdd3c2353eb0da05e5766b7a;hb=88e8e0e8a040866b0cbd87098c3595bf67b69765;hp=ba2e53d4b594a27f21a06a77ca8242b92c2e8b9b;hpb=c06bfef53f70551e7920bc4facce27f47b89e2ba;p=kiosk.git diff --git a/decorators.py b/decorators.py index ba2e53d..9995bd6 100644 --- a/decorators.py +++ b/decorators.py @@ -2,18 +2,18 @@ from datetime import datetime import functools +import logging + + +logger = logging.getLogger(__file__) def invocation_logged(func): @functools.wraps(func) def wrapper(*args, **kwargs): - now = datetime.now() - timestamp = now.strftime("%d-%b-%Y (%H:%M:%S.%f)") - print("%s(%s): Entered function" % (func.__name__, timestamp)) + logger.debug(f'Entered {func.__qualname__}') ret = func(*args, **kwargs) - now = datetime.now() - timestamp = now.strftime("%d-%b-%Y (%H:%M:%S.%f)") - print("%s(%s): Exited function" % (func.__name__, timestamp)) + logger.debug(f'Exited {func.__qualname__}') return ret return wrapper