diff --git a/Framework/Utilities/decorators.py b/Framework/Utilities/decorators.py index 8aef51fb1..6cbd34790 100644 --- a/Framework/Utilities/decorators.py +++ b/Framework/Utilities/decorators.py @@ -1,7 +1,9 @@ import time import functools from . import CommonUtil +from datetime import datetime +datetime_format = "%d-%b-%Y %H:%M:%S" def logger(func): """Log the entry and exit of the decorated function""" @@ -9,7 +11,7 @@ def logger(func): @functools.wraps(func) def wrapper(*args, **kwargs): start_time = time.perf_counter() - CommonUtil.ExecLog(None, f"Entering into function: {func.__name__!r}.", 5) + CommonUtil.ExecLog(None, f"{datetime.now().strftime(datetime_format)} | Entering into function: {func.__name__!r}.", 5) result = func(*args, **kwargs) end_time = time.perf_counter() @@ -17,7 +19,7 @@ def wrapper(*args, **kwargs): CommonUtil.ExecLog( None, - f"Exited from function: {func.__name__!r}. Runtime: {run_time:.4f} secs.", + f"{datetime.now().strftime(datetime_format)} | Exited from function: {func.__name__!r}. Runtime: {run_time:.4f} secs.", 5, )