More cleanup.
[kiosk.git] / decorators.py
index ba2e53d4b594a27f21a06a77ca8242b92c2e8b9b..9995bd67ecae0479fdd3c2353eb0da05e5766b7a 100644 (file)
@@ -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