about summary refs log tree commit diff
path: root/bh20sequploader/qc_metadata.py
diff options
context:
space:
mode:
authorPjotr Prins2020-05-28 10:44:42 -0500
committerPjotr Prins2020-05-28 10:44:42 -0500
commit2bcf4c45eaba42b36cff93c9cd5e461baaf3eae1 (patch)
tree2e8e789fb0261d0230db76b2f00e50ec40d83291 /bh20sequploader/qc_metadata.py
parent64d832fb49d8ef3799290ec5bd67c69c2c87e5d6 (diff)
downloadbh20-seq-resource-2bcf4c45eaba42b36cff93c9cd5e461baaf3eae1.tar.gz
bh20-seq-resource-2bcf4c45eaba42b36cff93c9cd5e461baaf3eae1.tar.lz
bh20-seq-resource-2bcf4c45eaba42b36cff93c9cd5e461baaf3eae1.zip
Web: debugging metadata submission
Diffstat (limited to 'bh20sequploader/qc_metadata.py')
-rw-r--r--bh20sequploader/qc_metadata.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bh20sequploader/qc_metadata.py b/bh20sequploader/qc_metadata.py
index fbfd286..9122ace 100644
--- a/bh20sequploader/qc_metadata.py
+++ b/bh20sequploader/qc_metadata.py
@@ -8,7 +8,9 @@ import traceback
 from rdflib import Graph, Namespace
 from pyshex.evaluate import evaluate
 
+
 def qc_metadata(metadatafile):
+    log = logging.getLogger(__name__ )
     schema_resource = pkg_resources.resource_stream(__name__, "bh20seq-schema.yml")
     cache = {"https://raw.githubusercontent.com/arvados/bh20-seq-resource/master/bh20sequploader/bh20seq-schema.yml": schema_resource.read().decode("utf-8")}
     (document_loader,
@@ -28,10 +30,11 @@ def qc_metadata(metadatafile):
         rslt, reason = evaluate(g, shex, doc["id"], "https://raw.githubusercontent.com/arvados/bh20-seq-resource/master/bh20sequploader/bh20seq-shex.rdf#submissionShape")
 
         if not rslt:
+            log.debug(reason)
             print(reason)
 
         return rslt
     except Exception as e:
         traceback.print_exc()
-        logging.warn(e)
+        log.warn(e)
     return False