From 212feddbde7aac44751e6339c71403c16f483918 Mon Sep 17 00:00:00 2001 From: Tom Webber Date: Mon, 29 Jul 2024 10:08:32 +0100 Subject: [PATCH] tweak: move all timings into single logging call --- ingestion/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ingestion/utils.py b/ingestion/utils.py index 505a5d4..3b6efcc 100644 --- a/ingestion/utils.py +++ b/ingestion/utils.py @@ -20,10 +20,11 @@ def st_func(*args, **kwargs): logging.info( f"Function={func.__name__}, arg_types={arg_types}, kwargs={kwargs}, " f"start_time={time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(t1))}, " - f"end_time={time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(t2))}" + f"end_time={time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(t2))}, " + f"elapsed_time={str(timedelta(seconds=elapsed))}" ) logging.info( - f"Function={func.__name__}, arg_types={arg_types}, kwargs={kwargs}, elapsed_time={str(timedelta(seconds=elapsed))}" + f"Function={func.__name__}, arg_types={arg_types}, kwargs={kwargs}" ) return r