From fd80d24db01e9c632dfb83893cca9fca50ac4d4f Mon Sep 17 00:00:00 2001 From: abdollahis2 Date: Wed, 8 Nov 2023 15:24:37 -0500 Subject: [PATCH 1/2] adding extra logging info --- tr_sys/tr_ars/utils.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tr_sys/tr_ars/utils.py b/tr_sys/tr_ars/utils.py index d7a58b31..d4bb1a44 100644 --- a/tr_sys/tr_ars/utils.py +++ b/tr_sys/tr_ars/utils.py @@ -286,14 +286,11 @@ def mergeMessagesRecursive(mergedMessage,messageList,pk): if len(messageList)==0: try: results = mergedMessage.getResults() - logging.info('the type of results for mergedMessage.getResults class %s' % (type(results))) if results is not None: logging.info(f'Averaing normalized scores for {pk}') try: results = results.getRaw() - logging.info('the type of results for results.getRaw class %s' % (type(results))) for result in results: - logging.info('result.keys are: %s' % (result.keys())) if "normalized_score" in result.keys(): ns = result["normalized_score"] if isinstance(ns,list) and len(ns)>0: @@ -606,8 +603,8 @@ def merge_and_post_process(parent_pk,message_to_merge, agent_name): merged = merge_received(parent_pk,message_to_merge, agent_name) post_process(merged.data,merged.id, agent_name) except Exception as e: - logging.debug("Problem with merger or post processing for agent %s pk: %s " % (agent_name, (parent_pk))) logging.exception("error in merger or post processing") + logging.info("Problem with merger or post processing for agent %s pk: %s " % (agent_name, (parent_pk))) merged.status='E' merged.code = 422 merged.save() @@ -1200,8 +1197,8 @@ def merge_received(parent_pk,message_to_merge, agent_name, counter=0): parent.save() return new_merged_message except Exception as e: + logging.exception("problem with merging for %s :" % agent_name) raise e - logging.exception("problem with merging for %s :" % agent_name) #If anything goes wrong, we at least need to unlock the semaphore #TODO make some actual proper Exception handling here. parent.merge_semaphore=False From d250607145f08932a065efdc082d85bb8a9be154 Mon Sep 17 00:00:00 2001 From: abdollahis2 Date: Wed, 8 Nov 2023 15:31:09 -0500 Subject: [PATCH 2/2] adding extra logging info --- tr_sys/tr_ars/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tr_sys/tr_ars/utils.py b/tr_sys/tr_ars/utils.py index d4bb1a44..38219490 100644 --- a/tr_sys/tr_ars/utils.py +++ b/tr_sys/tr_ars/utils.py @@ -1178,6 +1178,7 @@ def merge_received(parent_pk,message_to_merge, agent_name, counter=0): merged_dict = merged.to_dict() + logging.info('the keys for merged_dict are %s' % merged_dict.keys()) new_merged_message.data=merged_dict new_merged_message.status='R' new_merged_message.code=202