From cda7527c645c3f9c0aebcb8bc03e6a411f269984 Mon Sep 17 00:00:00 2001 From: Jeffrey Farrar Painter Date: Wed, 7 Apr 2021 13:35:50 -0700 Subject: [PATCH] several small improvements in logging --- synda/sdt/sdjson.py | 1 + synda/sdt/sdlogon.py | 2 +- synda/sdt/sdparse.py | 11 +++++++++++ synda/sdt/sdremotequtils.py | 5 +++-- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/synda/sdt/sdjson.py b/synda/sdt/sdjson.py index b9a28318..9054e342 100755 --- a/synda/sdt/sdjson.py +++ b/synda/sdt/sdjson.py @@ -22,6 +22,7 @@ def parse_parameters(buffer): try: xmldoc = json.loads(buffer) except Exception as e: + sdlog.debug("SYNDJSON-010","exception %s"%e) raise params={} diff --git a/synda/sdt/sdlogon.py b/synda/sdt/sdlogon.py index 3b00f954..2cc1fafe 100755 --- a/synda/sdt/sdlogon.py +++ b/synda/sdt/sdlogon.py @@ -106,7 +106,7 @@ def renew_certificate(openid, password, force_renew_certificate=False, force_ren except Exception as e: sdlog.error( "SYDLOGON-012", - "Error occured while retrieving certificate from myproxy server (%s)" % str(e), + "Error %s while retrieving certificate from myproxy server %s" % (str(e),hostname) ) raise diff --git a/synda/sdt/sdparse.py b/synda/sdt/sdparse.py index 434e1865..dcde9f54 100755 --- a/synda/sdt/sdparse.py +++ b/synda/sdt/sdparse.py @@ -21,6 +21,7 @@ from synda.sdt import sdprint from synda.sdt import sdi18n from synda.sdt import sdearlystreamutils +from synda.sdt import sdlog from synda.source.config.file.selection.models import Config as SelectionConfig from synda.source.config.file.selection.constants import PENDING_PARAMETER @@ -130,6 +131,16 @@ def build(buffer, load_default=None): # set default_selection as parent of project_default_selection project_default_selection.parent = default_selection + if selection.filename is not None: + sdlog.info('SDPARSE-0001','selection.filename=%s'%selection.filename) + sdlog.info('SDPARSE-0002','searchapi_host facet=%s'%selection.facets.get('searchapi_host')) + if selection.facets.get('searchapi_host') is not None and\ + len(selection.facets['searchapi_host'])>0 and\ + selection.facets['searchapi_host'][0] is not None: + sdlog.info('SDPARSE-0003','selection %s has searchapi_host=%s'% + (selection.filename,selection.facets['searchapi_host'])) + Selection.searchapi_host = selection.facets['searchapi_host'][0] + return selection diff --git a/synda/sdt/sdremotequtils.py b/synda/sdt/sdremotequtils.py index a7148cea..57f5db63 100755 --- a/synda/sdt/sdremotequtils.py +++ b/synda/sdt/sdremotequtils.py @@ -23,6 +23,7 @@ from synda.sdt import sdurlutils from synda.source.config.file.user.preferences.models import Config as Preferences from synda.source.config.file.internal.models import Config as Internal +from synda.sdt import sdlog def serialize_parameters(facets): @@ -67,10 +68,10 @@ def serialize_parameter__ovpp(name, values): # (The '*' at the end of the instance_id value signals the need for wildcards.) # That's because when the SOLR index is built, sometimes the name is changed (by suffixing # "_0" or "_1", etc.) to preserve uniqueness. And only string search supports wildcards. - # sdlog.info("JFPRMTQUTS01","name=%s, values=%s"%(name,values)) + # sdlog.info("SDRMTQUTS_01","name=%s, values=%s"%(name,values)) name = "query" values = ["id:" + v + "*" for v in values] - # sdlog.info("JFPRMTQUTS02","name=%s, values=%s"%(name,values)) + # sdlog.info("SDRMTQUTS_02","name=%s, values=%s"%(name,values)) for v in values: l.append(name + "=" + v)