# HG changeset patch # User Chris Cannam # Date 1479902753 0 # Node ID 0be716283c612e16a7adc484d29a712105237965 # Parent 3e85b5370690e61a52b13a9121c8ce830e42e052 More error reporting updates diff -r 3e85b5370690 -r 0be716283c61 .hgsubstate --- a/.hgsubstate Wed Nov 23 10:42:35 2016 +0000 +++ b/.hgsubstate Wed Nov 23 12:05:53 2016 +0000 @@ -3,5 +3,5 @@ 896aefe629c85b05ae0880ec93a396b9e3a5a304 dataquay 3257ddb6fff110cc88f3ffeaeefa0f29d5eb3b6f piper-cpp e1712f7d74a455337591091a57beba2f0443b9dd sv-dependency-builds -2f468f43c02c7c5689fae7c82832e3912dd79064 svcore +16a8e97179d7978bc467b983bb27448aced0092c svcore 0eebd22a081a824067bf3d5de65326696feab653 vamp-plugin-sdk diff -r 3e85b5370690 -r 0be716283c61 runner/FeatureExtractionManager.cpp --- a/runner/FeatureExtractionManager.cpp Wed Nov 23 10:42:35 2016 +0000 +++ b/runner/FeatureExtractionManager.cpp Wed Nov 23 12:05:53 2016 +0000 @@ -1027,12 +1027,12 @@ if (transform.getSummaryType() == Transform::NoSummary && !m_summaries.empty()) { - SVDEBUG << "transform has no summary, but summaries requested on command line, so going for it anyway" << endl; + SVDEBUG << "writeFeatures: transform has no summary, but summaries requested on command line, so going for it anyway" << endl; } else if (transform.getSummaryType() != summaryType) { // Either we're not writing a summary and the transform // has one, or we're writing a summary but the transform // has none or a different one; either way, skip it - SVDEBUG << "summary type differs from passed-in one " << summaryType << endl; + SVDEBUG << "writeFeatures: transform summary type " << transform.getSummaryType() << " differs from passed-in one " << summaryType << ", skipping" << endl; continue; } diff -r 3e85b5370690 -r 0be716283c61 runner/main.cpp --- a/runner/main.cpp Wed Nov 23 10:42:35 2016 +0000 +++ b/runner/main.cpp Wed Nov 23 12:05:53 2016 +0000 @@ -478,7 +478,7 @@ QDir dir(dirname); QString printable = dir.dirName().left(20); - cerr << "\rScanning \"" << printable << "\"..." + SVCERR << "\rScanning \"" << printable << "\"..." << QString(" ").left(20 - printable.length()) << " [" << found << " audio file(s)]"; @@ -505,6 +505,7 @@ QStringList expanded; foreach (QString path, sources) { if (QFileInfo(path).suffix().toLower() == "m3u") { + SVDEBUG << "Expanding m3u playlist file \"" << path << "\"" << endl; ProgressPrinter retrievalProgress("Opening playlist file..."); FileSource source(path, &retrievalProgress); if (!source.isAvailable()) { @@ -523,6 +524,8 @@ for (int i = 0; i < (int)files.size(); ++i) { expanded.push_back(files[i]); } + SVDEBUG << "Done, m3u playlist references " + << files.size() << " file(s)" << endl; } } else { // not a playlist @@ -538,7 +541,7 @@ { FileSource source(url); if (!source.isAvailable()) { - cerr << "File or URL \"" << url << "\" could not be retrieved" << endl; + SVCERR << "File or URL \"" << url << "\" could not be retrieved" << endl; return false; } source.waitForData(); @@ -546,7 +549,7 @@ QString filename = source.getLocalFilename(); QFile file(filename); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { - cerr << "File \"" << filename << "\" could not be read" << endl; + SVCERR << "File \"" << filename << "\" could not be read" << endl; return false; } @@ -569,7 +572,7 @@ importantBit = bits[0]; } if (importantBit == QString()) { - cerr << "WARNING: Skipping line " << lineNo << " (no content found)" + SVCERR << "WARNING: Skipping line " << lineNo << " (no content found)" << endl; continue; } @@ -577,7 +580,7 @@ boundaries.insert(Vamp::RealTime::fromSeconds (importantBit.toDouble(&good))); if (!good) { - cerr << "Unparseable or non-numeric segment boundary at line " + SVCERR << "Unparseable or non-numeric segment boundary at line " << lineNo << endl; return false; } @@ -1044,6 +1047,7 @@ for (set::const_iterator i = requestedTransformListFiles.begin(); i != requestedTransformListFiles.end(); ++i) { + SVDEBUG << "Reading transform list file \"" << *i << "\"" << endl; PlaylistFileReader reader(i->c_str()); if (reader.isOK()) { vector files = reader.load(); @@ -1051,7 +1055,7 @@ requestedTransformFiles.insert(files[j].toStdString()); } } else { - cerr << myname << ": failed to read template list file \"" << *i << "\"" << endl; + SVCERR << myname << ": failed to read transform list file \"" << *i << "\"" << endl; exit(2); } } @@ -1063,10 +1067,10 @@ for (QStringList::const_iterator i = otherArgs.begin(); i != otherArgs.end(); ++i) { if (QDir(*i).exists()) { - cerr << "Directory found and recursive flag set, scanning for audio files..." << endl; + SVCERR << "Directory found and recursive flag set, scanning for audio files..." << endl; int found = 0; findSourcesRecursive(*i, sources, found); - cerr << "\rDone, found " << found << " supported audio file(s) " << endl; + SVCERR << "\rDone, found " << found << " supported audio file(s) " << endl; } else { sources.push_back(*i); } @@ -1084,16 +1088,16 @@ manager.addSource(*i, multiplex); } catch (const std::exception &e) { badSources.insert(*i); - cerr << "ERROR: Failed to process file \"" << i->toStdString() + SVCERR << "ERROR: Failed to process file \"" << i->toStdString() << "\": " << e.what() << endl; if (force) { // print a note only if we have more files to process QStringList::const_iterator j = i; if (++j != sources.end()) { - cerr << "NOTE: \"--force\" option was provided, continuing (more errors may occur)" << endl; + SVCERR << "NOTE: \"--force\" option was provided, continuing (more errors may occur)" << endl; } } else { - cerr << "NOTE: If you want to continue with processing any further files after an" << endl + SVCERR << "NOTE: If you want to continue with processing any further files after an" << endl << "error like this, use the --force option" << endl; good = false; break; @@ -1110,7 +1114,7 @@ if (manager.addFeatureExtractorFromFile(i->c_str(), writers)) { haveFeatureExtractor = true; } else { - cerr << "ERROR: Failed to add feature extractor from transform file \"" << *i << "\"" << endl; + SVCERR << "ERROR: Failed to add feature extractor from transform file \"" << *i << "\"" << endl; good = false; } } @@ -1120,13 +1124,13 @@ if (manager.addDefaultFeatureExtractor(i->c_str(), writers)) { haveFeatureExtractor = true; } else { - cerr << "ERROR: Failed to add default feature extractor for transform \"" << *i << "\"" << endl; + SVCERR << "ERROR: Failed to add default feature extractor for transform \"" << *i << "\"" << endl; good = false; } } if (!haveFeatureExtractor) { - cerr << myname << ": no feature extractors added" << endl; + SVCERR << myname << ": no feature extractors added" << endl; good = false; } } @@ -1145,7 +1149,7 @@ } manager.extractFeaturesMultiplexed(goodSources); } catch (const std::exception &e) { - cerr << "ERROR: Feature extraction failed: " + SVCERR << "ERROR: Feature extraction failed: " << e.what() << endl; } } else {