summaryrefslogtreecommitdiff
path: root/decorator_utils.py
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2021-11-14 15:46:39 -0800
committerScott Gasch <[email protected]>2021-11-14 15:46:39 -0800
commit8f7f3c61e14c903e0b9a151971940b945d306bfd (patch)
treee5adcc4727dce053abd042ed6c62ed91ca866989 /decorator_utils.py
parent957c962294cde93c4c649ed18dedd16df071878d (diff)
Small changes to decorators.
Diffstat (limited to 'decorator_utils.py')
-rw-r--r--decorator_utils.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/decorator_utils.py b/decorator_utils.py
index e19759f..4f98a6d 100644
--- a/decorator_utils.py
+++ b/decorator_utils.py
@@ -47,15 +47,11 @@ def invocation_logged(func: Callable) -> Callable:
@functools.wraps(func)
def wrapper_invocation_logged(*args, **kwargs):
- now = datetime.datetime.now()
- ts = now.strftime("%Y/%d/%b:%H:%M:%S%Z")
- msg = f"[{ts}]: Entered {func.__name__}"
+ msg = f"Entered {func.__qualname__}"
print(msg)
logger.info(msg)
ret = func(*args, **kwargs)
- now = datetime.datetime.now()
- ts = now.strftime("%Y/%d/%b:%H:%M:%S%Z")
- msg = f"[{ts}]: Exited {func.__name__}"
+ msg = f"Exited {func.__qualname__}"
print(msg)
logger.info(msg)
return ret
@@ -297,8 +293,8 @@ def thunkify(func):
exc[0] = True
exc[1] = sys.exc_info() # (type, value, traceback)
msg = f"Thunkify has thrown an exception (will be raised on thunk()):\n{traceback.format_exc()}"
- logger.warning(msg)
print(msg)
+ logger.warning(msg)
finally:
wait_event.set()