comparison rdf/PluginRDFIndexer.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
comparison
equal deleted inserted replaced
686:b4a8d8221eaf 687:06f13a3b9e9e
115 } 115 }
116 116
117 bool 117 bool
118 PluginRDFIndexer::indexConfiguredURLs() 118 PluginRDFIndexer::indexConfiguredURLs()
119 { 119 {
120 std::cerr << "PluginRDFIndexer::indexConfiguredURLs" << std::endl; 120 DEBUG << "PluginRDFIndexer::indexConfiguredURLs" << endl;
121 121
122 QSettings settings; 122 QSettings settings;
123 settings.beginGroup("RDF"); 123 settings.beginGroup("RDF");
124 124
125 QString indexKey("rdf-indices"); 125 QString indexKey("rdf-indices");
127 127
128 for (int i = 0; i < indices.size(); ++i) { 128 for (int i = 0; i < indices.size(); ++i) {
129 129
130 QString index = indices[i]; 130 QString index = indices[i];
131 131
132 std::cerr << "PluginRDFIndexer::indexConfiguredURLs: index url is " 132 DEBUG << "PluginRDFIndexer::indexConfiguredURLs: index url is "
133 << index << std::endl; 133 << index << endl;
134 134
135 CachedFile cf(index); 135 CachedFile cf(index);
136 if (!cf.isOK()) continue; 136 if (!cf.isOK()) continue;
137 137
138 FileSource indexSource(cf.getLocalFilename()); 138 FileSource indexSource(cf.getLocalFilename());
141 if (!reader.isOK()) continue; 141 if (!reader.isOK()) continue;
142 142
143 PlaylistFileReader::Playlist list = reader.load(); 143 PlaylistFileReader::Playlist list = reader.load();
144 for (PlaylistFileReader::Playlist::const_iterator j = list.begin(); 144 for (PlaylistFileReader::Playlist::const_iterator j = list.begin();
145 j != list.end(); ++j) { 145 j != list.end(); ++j) {
146 std::cerr << "PluginRDFIndexer::indexConfiguredURLs: url is " 146 DEBUG << "PluginRDFIndexer::indexConfiguredURLs: url is "
147 << j->toStdString() << std::endl; 147 << j->toStdString() << endl;
148 pullURL(*j); 148 pullURL(*j);
149 } 149 }
150 } 150 }
151 151
152 QString urlListKey("rdf-urls"); 152 QString urlListKey("rdf-urls");
239 { 239 {
240 Profiler profiler("PluginRDFIndexer::indexURL"); 240 Profiler profiler("PluginRDFIndexer::indexURL");
241 241
242 loadPrefixes(); 242 loadPrefixes();
243 243
244 // std::cerr << "PluginRDFIndexer::indexURL(" << urlString << ")" << std::endl; 244 // DEBUG << "PluginRDFIndexer::indexURL(" << urlString << ")" << endl;
245 245
246 QMutexLocker locker(&m_mutex); 246 QMutexLocker locker(&m_mutex);
247 247
248 QString localString = urlString; 248 QString localString = urlString;
249 249
291 << query.getErrorString() << endl; 291 << query.getErrorString() << endl;
292 return false; 292 return false;
293 } 293 }
294 294
295 if (results.empty()) { 295 if (results.empty()) {
296 cerr << "PluginRDFIndexer::reindex: NOTE: no vamp:Plugin resources found in indexed documents" << endl; 296 DEBUG << "PluginRDFIndexer::reindex: NOTE: no vamp:Plugin resources found in indexed documents" << endl;
297 return false; 297 return false;
298 } 298 }
299 299
300 bool foundSomething = false; 300 bool foundSomething = false;
301 bool addedSomething = false; 301 bool addedSomething = false;
306 QString pluginUri = (*i)["plugin"].value; 306 QString pluginUri = (*i)["plugin"].value;
307 QString soUri = (*i)["library"].value; 307 QString soUri = (*i)["library"].value;
308 QString identifier = (*i)["plugin_id"].value; 308 QString identifier = (*i)["plugin_id"].value;
309 309
310 if (identifier == "") { 310 if (identifier == "") {
311 cerr << "PluginRDFIndexer::reindex: NOTE: No vamp:identifier for plugin <" 311 DEBUG << "PluginRDFIndexer::reindex: NOTE: No vamp:identifier for plugin <"
312 << pluginUri << ">" 312 << pluginUri << ">"
313 << endl; 313 << endl;
314 continue; 314 continue;
315 } 315 }
316 if (soUri == "") { 316 if (soUri == "") {
317 cerr << "PluginRDFIndexer::reindex: NOTE: No implementation library for plugin <" 317 DEBUG << "PluginRDFIndexer::reindex: NOTE: No implementation library for plugin <"
318 << pluginUri << ">" 318 << pluginUri << ">"
319 << endl; 319 << endl;
320 continue; 320 continue;
321 } 321 }
322 322
332 332
333 SimpleSPARQLQuery::Value sonameValue = 333 SimpleSPARQLQuery::Value sonameValue =
334 SimpleSPARQLQuery::singleResultQuery(m, sonameQuery, "library_id"); 334 SimpleSPARQLQuery::singleResultQuery(m, sonameQuery, "library_id");
335 QString soname = sonameValue.value; 335 QString soname = sonameValue.value;
336 if (soname == "") { 336 if (soname == "") {
337 cerr << "PluginRDFIndexer::reindex: NOTE: No identifier for library <" 337 DEBUG << "PluginRDFIndexer::reindex: NOTE: No identifier for library <"
338 << soUri << ">" 338 << soUri << ">"
339 << endl; 339 << endl;
340 continue; 340 continue;
341 } 341 }
342 342
353 353
354 addedSomething = true; 354 addedSomething = true;
355 355
356 if (pluginUri != "") { 356 if (pluginUri != "") {
357 if (m_uriToIdMap.find(pluginUri) != m_uriToIdMap.end()) { 357 if (m_uriToIdMap.find(pluginUri) != m_uriToIdMap.end()) {
358 cerr << "PluginRDFIndexer::reindex: WARNING: Found multiple plugins with the same URI:" << endl; 358 DEBUG << "PluginRDFIndexer::reindex: WARNING: Found multiple plugins with the same URI:" << endl;
359 cerr << " 1. Plugin id \"" << m_uriToIdMap[pluginUri] << "\"" << endl; 359 cerr << " 1. Plugin id \"" << m_uriToIdMap[pluginUri] << "\"" << endl;
360 cerr << " 2. Plugin id \"" << pluginId << "\"" << endl; 360 cerr << " 2. Plugin id \"" << pluginId << "\"" << endl;
361 cerr << "both claim URI <" << pluginUri << ">" << endl; 361 cerr << "both claim URI <" << pluginUri << ">" << endl;
362 } else { 362 } else {
363 m_uriToIdMap[pluginUri] = pluginId; 363 m_uriToIdMap[pluginUri] = pluginId;
364 } 364 }
365 } 365 }
366 } 366 }
367 367
368 if (!foundSomething) { 368 if (!foundSomething) {
369 cerr << "PluginRDFIndexer::reindex: NOTE: Plugins found, but none sufficiently described" << endl; 369 DEBUG << "PluginRDFIndexer::reindex: NOTE: Plugins found, but none sufficiently described" << endl;
370 } 370 }
371 371
372 return addedSomething; 372 return addedSomething;
373 } 373 }
374 374