# HG changeset patch # User Chris Cannam # Date 1526639222 -3600 # Node ID ef03350baec7ba72e5465173de3e404e813753a4 # Parent 50461005ffcbe4fc21a6c070e3c9920ded12e0d9 Switch some more cerrs to SVCERRs diff -r 50461005ffcb -r ef03350baec7 runner/AudioDBFeatureWriter.cpp --- a/runner/AudioDBFeatureWriter.cpp Fri May 18 10:05:03 2018 +0100 +++ b/runner/AudioDBFeatureWriter.cpp Fri May 18 11:27:02 2018 +0100 @@ -113,7 +113,7 @@ //!!! use summaryType if (summaryType != "") { //!!! IMPLEMENT - cerr << "ERROR: AudioDBFeatureWriter::write: Writing summaries is not yet implemented!" << endl; + SVCERR << "ERROR: AudioDBFeatureWriter::write: Writing summaries is not yet implemented!" << endl; exit(1); } @@ -151,7 +151,7 @@ // - it can be zero, i.e. if the output is really a set of labels + timestamps *dbfiles[output.identifier].ofs /*<< ios::binary*/ << output.binCount; - cerr << "writing bin count " << output.binCount << " for " << output.identifier << endl; + SVCERR << "writing bin count " << output.binCount << " for " << output.identifier << endl; } if (replaceDBFile(trackid, output.identifier + ".timestamp")) @@ -177,11 +177,11 @@ QString trackBase = QFileInfo(trackid).fileName(); string filepath = baseDir + "/" + catalogueId + "/" + trackBase.toStdString() + "." + identifier; - cerr << "AudioDBFeatureWriter::openDBFile: filepath is \"" << filepath << "\"" << endl; + SVCERR << "AudioDBFeatureWriter::openDBFile: filepath is \"" << filepath << "\"" << endl; ofstream* ofs = new ofstream(filepath.c_str()); if (!*ofs) { - cerr << "ERROR AudioDBFeatureWriter::openDBFile(): can't open file " << filepath << endl; + SVCERR << "ERROR AudioDBFeatureWriter::openDBFile(): can't open file " << filepath << endl; return false; } TrackStream ts; diff -r 50461005ffcb -r ef03350baec7 runner/JAMSFeatureWriter.cpp --- a/runner/JAMSFeatureWriter.cpp Fri May 18 10:05:03 2018 +0100 +++ b/runner/JAMSFeatureWriter.cpp Fri May 18 11:27:02 2018 +0100 @@ -20,6 +20,7 @@ using Vamp::PluginBase; #include "base/Exceptions.h" +#include "base/Debug.h" #include "rdf/PluginRDFIndexer.h" #include @@ -82,8 +83,8 @@ } else if (i->first == "digits") { int digits = atoi(i->second.c_str()); if (digits <= 0 || digits > 100) { - cerr << "JAMSFeatureWriter: ERROR: Invalid or out-of-range value for number of significant digits: " << i->second << endl; - cerr << "JAMSFeatureWriter: NOTE: Continuing with default settings" << endl; + SVCERR << "JAMSFeatureWriter: ERROR: Invalid or out-of-range value for number of significant digits: " << i->second << endl; + SVCERR << "JAMSFeatureWriter: NOTE: Continuing with default settings" << endl; } else { m_digits = digits; } @@ -338,14 +339,14 @@ m_rdfDescriptions[pluginId] = PluginRDFDescription(pluginId); if (m_rdfDescriptions[pluginId].haveDescription()) { - cerr << "NOTE: Have RDF description for plugin ID \"" + SVCERR << "NOTE: Have RDF description for plugin ID \"" << pluginId << "\"" << endl; } else { - cerr << "NOTE: No RDF description for plugin ID \"" + SVCERR << "NOTE: No RDF description for plugin ID \"" << pluginId << "\"" << endl; if (!m_network) { - cerr << " Consider using the --jams-network option to retrieve plugin descriptions" << endl; - cerr << " from the network where possible." << endl; + SVCERR << " Consider using the --jams-network option to retrieve plugin descriptions" << endl; + SVCERR << " from the network where possible." << endl; } } } @@ -399,14 +400,14 @@ } else if (eventUri == af + "StructuralSegment") { task = SegmentTask; } else { - cerr << "WARNING: Unsupported event type URI <" + SVCERR << "WARNING: Unsupported event type URI <" << eventUri << ">, proceeding with UnknownTask type" << endl; } } else { - cerr << "WARNING: Cannot currently write dense or track-level outputs to JAMS format (only sparse ones). Will proceed using UnknownTask type, but this probably isn't going to work" << endl; + SVCERR << "WARNING: Cannot currently write dense or track-level outputs to JAMS format (only sparse ones). Will proceed using UnknownTask type, but this probably isn't going to work" << endl; } } diff -r 50461005ffcb -r ef03350baec7 runner/LabFeatureWriter.cpp --- a/runner/LabFeatureWriter.cpp Fri May 18 10:05:03 2018 +0100 +++ b/runner/LabFeatureWriter.cpp Fri May 18 11:27:02 2018 +0100 @@ -79,8 +79,8 @@ } else if (i->first == "digits") { int digits = atoi(i->second.c_str()); if (digits <= 0 || digits > 100) { - cerr << "LabFeatureWriter: ERROR: Invalid or out-of-range value for number of significant digits: " << i->second << endl; - cerr << "LabFeatureWriter: NOTE: Continuing with default settings" << endl; + SVCERR << "LabFeatureWriter: ERROR: Invalid or out-of-range value for number of significant digits: " << i->second << endl; + SVCERR << "LabFeatureWriter: NOTE: Continuing with default settings" << endl; } else { m_digits = digits; } diff -r 50461005ffcb -r ef03350baec7 runner/MIDIFeatureWriter.cpp --- a/runner/MIDIFeatureWriter.cpp Fri May 18 10:05:03 2018 +0100 +++ b/runner/MIDIFeatureWriter.cpp Fri May 18 11:27:02 2018 +0100 @@ -20,6 +20,7 @@ using Vamp::PluginBase; #include "base/Exceptions.h" +#include "base/Debug.h" #include "data/fileio/MIDIFileWriter.h" //#define DEBUG_MIDI_FEATURE_WRITER 1 @@ -58,7 +59,7 @@ void MIDIFeatureWriter::setTrackMetadata(QString, TrackMetadata) { - cerr << "MIDIFeatureWriter::setTrackMetadata: not supported (yet?)" << endl; + SVCERR << "MIDIFeatureWriter::setTrackMetadata: not supported (yet?)" << endl; } void @@ -112,8 +113,8 @@ } #ifdef DEBUG_MIDI_FEATURE_WRITER - cerr << "feature timestamp = " << feature.timestamp << ", sampleRate = " << sampleRate << ", frame = " << frame << endl; - cerr << "feature duration = " << feature.duration << ", sampleRate = " << sampleRate << ", duration = " << duration << endl; + SVCERR << "feature timestamp = " << feature.timestamp << ", sampleRate = " << sampleRate << ", frame = " << frame << endl; + SVCERR << "feature duration = " << feature.duration << ", sampleRate = " << sampleRate << ", duration = " << duration << endl; #endif int pitch = 60; @@ -158,16 +159,16 @@ { MIDIFileWriter writer(filename, &exportable, rate); if (!writer.isOK()) { - cerr << "ERROR: Failed to create MIDI writer: " - << writer.getError() << endl; + SVCERR << "ERROR: Failed to create MIDI writer: " + << writer.getError() << endl; throw FileOperationFailed(filename, "create MIDI writer"); } writer.write(); if (!writer.isOK()) { - cerr << "ERROR: Failed to write to MIDI file: " - << writer.getError() << endl; + SVCERR << "ERROR: Failed to write to MIDI file: " + << writer.getError() << endl; throw FileOperationFailed(filename, "MIDI write"); } }