606236f5d8fc — Chris Cannam tip 5 months ago
Use category logger
M repoint-lock.json +6 -6
@@ 1,22 1,22 @@ 
 {
   "libraries": {
     "sml-smlnj-containers": {
-      "pin": "2c094258f541"
+      "pin": "3da179a6ce0c"
     },
     "sml-utf8": {
-      "pin": "45d450aedb1f"
+      "pin": "fe154fc33446"
     },
     "sml-trie": {
-      "pin": "2d2572df578d"
+      "pin": "89310846066c"
     },
     "sml-stringinterpolate": {
-      "pin": "7aeea879e5af"
+      "pin": "82b6a5a4fc8d"
     },
     "sml-log": {
-      "pin": "0084064e40bf"
+      "pin": "ece686d599d4"
     },
     "sml-buildscripts": {
-      "pin": "0753a33f4456"
+      "pin": "c34ab9a28379"
     }
   }
 }

          
M src/rdf-base.mlb +1 -0
@@ 1,4 1,5 @@ 
 prerequisites.mlb
+rdf-base/log.sml
 rdf-base/codepointset.sml
 rdf-base/string-compare.sml
 rdf-base/iri.sig

          
M src/rdf-base/collection-gatherer-fn.sml +8 -6
@@ 7,6 7,8 @@ functor CollectionGathererFn (M : MATCHE
     datatype node = datatype RdfNode.node
     type triple = node * node * node
 
+    open RdfLog
+             
     val nodeFirst = RdfNode.IRI RdfStandardIRIs.iriRdfFirst
     val nodeRest  = RdfNode.IRI RdfStandardIRIs.iriRdfRest
     val nodeNil   = RdfNode.IRI RdfStandardIRIs.iriRdfNil

          
@@ 16,9 18,9 @@ functor CollectionGathererFn (M : MATCHE
         let val pat = (SOME node, SOME nodeRest, NONE)
             val result = not (null (M.match (matcher, pat)))
         in
-            Log.info (fn () => ["Collection: %1 %2 a collection node",
-                                Log.S (RdfNode.stringOfNode node),
-                                Log.S (if result then "is" else "is not")]);
+            debug (fn () => ["Collection: %1 %2 a collection node",
+                             S (RdfNode.stringOfNode node),
+                             S (if result then "is" else "is not")]);
             result
         end
 

          
@@ 46,9 48,9 @@ functor CollectionGathererFn (M : MATCHE
                     end
             val result = triples' (matcher, (startOfCollection (matcher, node)), [])
         in
-            Log.info (fn () => ["Collection: node %1 yields collection:\n%",
-                                Log.S (RdfNode.stringOfNode node),
-                                Log.S (RdfTriple.stringOfTriples result)]);
+            debug (fn () => ["Collection: node %1 yields collection:\n%",
+                             S (RdfNode.stringOfNode node),
+                             S (RdfTriple.stringOfTriples result)]);
             result
         end
 

          
A => src/rdf-base/log.sml +4 -0
@@ 0,0 1,4 @@ 
+
+structure RdfLog = CategoryLogFn (struct
+                                   val category = "rdf"
+                                   end)

          
M src/store/store.sml +7 -5
@@ 3,6 3,8 @@ structure Store :> STORE = struct
 
     datatype node = datatype RdfNode.node
 
+    open RdfLog
+                                 
     type patnode = node option
     type triple = node * node * node
     type pattern = patnode * patnode * patnode

          
@@ 50,9 52,9 @@ structure Store :> STORE = struct
     fun foldlMatch f acc ({ prefixes, indexes } : t, pattern) =
         let val index = IndexPicker.pickIndex (indexes, pattern)
         in
-            Log.info (fn () => ["Store: pattern %1, index \"%2\"",
-                                Log.S (stringOfPattern pattern),
-                                Log.S (Index.name index)]);
+            debug (fn () => ["Store: pattern %1, index \"%2\"",
+                             S (stringOfPattern pattern),
+                             S (Index.name index)]);
             Index.foldlMatch f acc (index, pattern)
         end
 

          
@@ 62,8 64,8 @@ structure Store :> STORE = struct
     fun match pattern =
         let val result = foldlMatch (op::) [] pattern
         in
-            Log.info (fn () => ["Store: matched %1 results",
-                                Log.I (length result)]);
+            debug (fn () => ["Store: matched %1 results",
+                             I (length result)]);
             result
         end