Skip to content

Commit

Permalink
define getlogger
Browse files Browse the repository at this point in the history
  • Loading branch information
smrgeoinfo authored Dec 21, 2023
1 parent 66c4de3 commit 24d80ed
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tools/navocab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
"obo": "http://purl.obolibrary.org/obo/",
"geosciml": "http://resource.geosciml.org/classifier/cgi/lithology",
}
def getLogger():
return logging.getLogger("navocab")


L = logging.getLogger("navocab")
L = getLogger()

def skosT(term):
return rdflib.URIRef(f"{NS['skos']}{term}")
Expand Down Expand Up @@ -94,7 +95,7 @@ def purge_store(self):

def _initialize_store(self, purge=False):
"""Sets up the rdf store using an Sqlite cache."""
L = getLogger()
# L = getLogger()
L.debug("initialize SQLAlchemy datastore. purge:%s",purge)
graph = rdflib.ConjunctiveGraph("SQLAlchemy", identifier=self.store_identifier)

Expand Down Expand Up @@ -140,7 +141,7 @@ def load(
bindings: typing.Optional[dict] = None,
):
g_loaded = self._g.parse(source, format=format)
L = getLogger()
# L = getLogger()
L.info("Navocab.load.source: %s", source)

if bindings is not None:
Expand Down Expand Up @@ -229,7 +230,7 @@ def _one_res(self, rows, abbreviate=False) -> list[str]:
return res

def _result_single_value(self, rows, abbreviate=False) -> typing.Any:
L = getLogger()
# L = getLogger()
L.debug(f"result_single_value-count rows in query result: {len(rows)}")
for r in rows:
L.debug(f"VocabularyStore-result single value row: {self.compact_name(r[0])}")
Expand Down

0 comments on commit 24d80ed

Please sign in to comment.