Skip to content

Commit 9940be2

Browse files
committed
Less logging of debug messages by default
These are configurable so we can still debug at will. Co-author: @erikap
1 parent cd15c59 commit 9940be2

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

Diff for: cache/types.lisp

+9-4
Original file line numberDiff line numberDiff line change
@@ -147,22 +147,27 @@ Hence graph -> uri -> types in which every URI is expressed as a string and the
147147

148148
(defparameter *uri-graph-user-type-providers* nil
149149
"A list of functions that can calculate the types for a list of combined graph and uri.")
150+
(defparameter *debug-prefix-functions* nil
151+
"Set to non-nil to emit debugging information for prefix functions.")
150152

151153
(defun derive-type-from-prefix-function (prefix types &optional complete-p)
152154
"Constructs a function that derives the types of uris starting with PREFIX.
153155
154156
If COMPLETE-P is non-nil processing may be short-circuited but no
155157
guarantees are given for this to be used."
156158
(let ((prefix-length (length prefix)))
157-
(format t "~&Types is now: ~A~%" types)
159+
(when *debug-prefix-functions*
160+
(format t "~&Types is now: ~A~%" types))
158161
(lambda (uri graph)
159162
(declare (ignore graph))
160-
(format t "~&Types is now: ~A~%" types)
163+
(when *debug-prefix-functions*
164+
(format t "~&Types is now: ~A~%" types))
161165
(let ((uri-length (length uri)))
162166
(if (and (>= uri-length prefix-length)
163167
(string= prefix (subseq uri 0 prefix-length)))
164-
(progn (format t "~&Returning types ~A for uri ~A~%"
165-
types uri)
168+
(progn (when *debug-prefix-functions*
169+
(format t "~&Returning types ~A for uri ~A~%"
170+
types uri))
166171
(values types complete-p))
167172
(values nil nil))))))
168173

Diff for: connection/client.lisp

+5-1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ comparison."
9393
(expand-bindings bindings)
9494
bindings)))
9595

96+
(defparameter *log-batch-mapping* nil
97+
"Set to t to warn on processes which want to execute batch mapping. Batch mapping is not implemented yet and will process as one big query.")
98+
9699
(defun batch-map-solutions-for-select-query* (query &key (for :read) batch-size usage)
97100
(declare (ignore for batch-size))
98101
(sparql-parser:with-sparql-ast query
@@ -101,7 +104,8 @@ comparison."
101104
query))
102105
(query-string (sparql-generator:write-valid altered-query)))
103106
;; (break "Batch mapping ~A" query-string)
104-
(format t "~&Batch mapping ~A~%" query-string)
107+
(when *log-batch-mapping*
108+
(format t "~&Batch mapping ~A~%" query-string))
105109
(client:bindings (client:query query-string)))))
106110

107111
(defun batch-create-full-solution-for-select-query (query &key (for :read) batch-size usage)

0 commit comments

Comments
 (0)