From 7d955ff90f80195d92143b6fa848493570534332 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Sun, 7 Apr 2024 17:31:35 -0400 Subject: [PATCH] Clean up and less debug --- app/db_sql.py | 8 ++++++-- app/routers/api_crud.py | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/db_sql.py b/app/db_sql.py index 4c8493f..8f883bc 100644 --- a/app/db_sql.py +++ b/app/db_sql.py @@ -703,6 +703,7 @@ def sql_select( sql_fulltext_match_against = '' if fulltext_qry_dict: + log.info('Creating partial SQL string for fulltext search.') sql_fulltext_match_against, data_qry = sql_fulltext_qry_part(fulltext_qry_dict) # NOTE: Merge the data_qry result with the data dict @@ -710,6 +711,7 @@ def sql_select( sql_and_qry = '' if and_qry_dict: + log.info('Creating partial SQL string for AND search (equals).') sql_and_qry, data_qry = sql_and_qry_part(and_qry_dict) # NOTE: Merge the data_qry result with the data dict @@ -717,6 +719,7 @@ def sql_select( sql_and_like = '' if and_like_dict: + log.info('Creating partial SQL string for AND search (LIKE).') sql_and_like, data_qry = sql_and_like_part(and_like_dict) # NOTE: Merge the data_qry result with the data dict @@ -724,6 +727,7 @@ def sql_select( sql_and_in_dict_li = '' if and_in_dict_li: + log.info('Creating partial SQL string for AND search (IN).') sql_and_in_dict_li, data_qry = sql_and_in_dict_li_part(and_in_dict_li) # NOTE: Merge the data_qry result with the data dict @@ -845,7 +849,7 @@ def sql_select( # log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL log.debug(sql) log.debug(data) - # log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL + log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL result = run_sql_select(sql=sql, data=data) # log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL @@ -1725,7 +1729,7 @@ def sql_and_qry_part( def sql_and_like_part( and_like_dict_obj: dict, # One or more key value pairs. key = field name; value = search string ) -> bool|dict: - log.setLevel(logging.WARNING) + log.setLevel(logging.INFO) log.debug(locals()) data = {} diff --git a/app/routers/api_crud.py b/app/routers/api_crud.py index 04900a5..903daf1 100644 --- a/app/routers/api_crud.py +++ b/app/routers/api_crud.py @@ -251,7 +251,7 @@ async def get_obj_li( jp_obj = None if jp: - log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL + log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL log.debug( urllib.parse.unquote(jp) ) try: jp_obj = json.loads(urllib.parse.unquote(jp)) @@ -259,7 +259,7 @@ async def get_obj_li( log.warning(e) return mk_resp(data=False, status_code=400, response=commons.response, status_message='The JSON string was not formatted correctly.') - log.debug(jp_obj) + log.info(jp_obj) if jp_obj.get('ft_qry'): # NOTE: This is for the fulltext query fulltext_qry_dict_obj = jp_obj['ft_qry'] @@ -273,7 +273,7 @@ async def get_obj_li( if jp_obj.get('and_in_li'): # NOTE: This is for the additional AND IN clauses in the WHERE statement and_in_dict_li_obj = jp_obj['and_in_li'] - log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL + log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL if order_by_li: