diff rdf/SimpleSPARQLQuery.cpp @ 687:06f13a3b9e9e debug-output

Convert many cerrs to DEBUGs
author Chris Cannam
date Mon, 16 May 2011 17:19:09 +0100
parents b4a8d8221eaf
children 1424aa29ae95
line wrap: on
line diff
--- a/rdf/SimpleSPARQLQuery.cpp	Thu May 12 17:31:24 2011 +0100
+++ b/rdf/SimpleSPARQLQuery.cpp	Mon May 16 17:19:09 2011 +0100
@@ -178,17 +178,17 @@
 WredlandWorldWrapper::freeModel(QString forUri)
 {
 #ifdef DEBUG_SIMPLE_SPARQL_QUERY
-    std::cerr << "SimpleSPARQLQuery::freeModel: Model uri = \"" << forUri << "\"" << std::endl;
+    DEBUG << "SimpleSPARQLQuery::freeModel: Model uri = \"" << forUri << "\"" << endl;
 #endif
 
     QMutexLocker locker(&m_mutex);
     if (forUri == "") {
-        std::cerr << "SimpleSPARQLQuery::freeModel: ERROR: Can't free default model" << std::endl;
+        DEBUG << "SimpleSPARQLQuery::freeModel: ERROR: Can't free default model" << endl;
         return;
     }
     if (m_ownModelUris.find(forUri) == m_ownModelUris.end()) {
 #ifdef DEBUG_SIMPLE_SPARQL_QUERY
-        std::cerr << "SimpleSPARQLQuery::freeModel: NOTE: Unknown or already-freed model (uri = \"" << forUri << "\")" << std::endl;
+        DEBUG << "SimpleSPARQLQuery::freeModel: NOTE: Unknown or already-freed model (uri = \"" << forUri << "\")" << endl;
 #endif
         return;
     }
@@ -388,7 +388,7 @@
 SimpleSPARQLQuery::Impl::executeDirectParser()
 {
 #ifdef DEBUG_SIMPLE_SPARQL_QUERY
-    std::cerr << "SimpleSPARQLQuery::executeDirectParser: Query is: \"" << m_query << "\"" << std::endl;
+    DEBUG << "SimpleSPARQLQuery::executeDirectParser: Query is: \"" << m_query << "\"" << endl;
 #endif
 
     ResultList list;
@@ -399,13 +399,13 @@
     QString fromUri;
 
     if (fromRE.indexIn(m_query) < 0) {
-        std::cerr << "SimpleSPARQLQuery::executeDirectParser: Query contains no FROM clause, nothing to parse from" << std::endl;
+        DEBUG << "SimpleSPARQLQuery::executeDirectParser: Query contains no FROM clause, nothing to parse from" << endl;
         return list;
     } else {
         fromUri = fromRE.cap(1);
 #ifdef DEBUG_SIMPLE_SPARQL_QUERY
-        std::cerr << "SimpleSPARQLQuery::executeDirectParser: FROM URI is <"
-                  << fromUri << ">" << std::endl;
+        DEBUG << "SimpleSPARQLQuery::executeDirectParser: FROM URI is <"
+                  << fromUri << ">" << endl;
 #endif
     }
 
@@ -416,7 +416,7 @@
 SimpleSPARQLQuery::Impl::executeDatastore()
 {
 #ifdef DEBUG_SIMPLE_SPARQL_QUERY
-    std::cerr << "SimpleSPARQLQuery::executeDatastore: Query is: \"" << m_query << "\"" << std::endl;
+    DEBUG << "SimpleSPARQLQuery::executeDatastore: Query is: \"" << m_query << "\"" << endl;
 #endif
 
     ResultList list;
@@ -576,7 +576,7 @@
     librdf_free_query(query);
 
 #ifdef DEBUG_SIMPLE_SPARQL_QUERY
-    cerr << "SimpleSPARQLQuery::executeDatastore: All results retrieved (" << resultCount << " of them)" << endl;
+    DEBUG << "SimpleSPARQLQuery::executeDatastore: All results retrieved (" << resultCount << " of them)" << endl;
 #endif
 
     return list;
@@ -620,7 +620,7 @@
     SimpleSPARQLQuery q(type, query);
     ResultList results = q.execute();
     if (!q.isOK()) {
-        cerr << "SimpleSPARQLQuery::singleResultQuery: ERROR: "
+        DEBUG << "SimpleSPARQLQuery::singleResultQuery: ERROR: "
              << q.getErrorString() << endl;
         return Value();
     }