diff plugin/PiperVampPluginFactory.cpp @ 1247:8f076d02569a piper

Make SVDEBUG always write to a log file -- formerly this was disabled in NDEBUG builds. I think there's little use to that, it just means that we keep adding more cerr debug output because we aren't getting the log we need. And SVDEBUG logging is not usually used in tight loops, I don't think the performance overhead is too serious. Also update the About box.
author Chris Cannam
date Thu, 03 Nov 2016 14:57:00 +0000
parents 75aefcc9f07d
children 58dd6a6fe414
line wrap: on
line diff
--- a/plugin/PiperVampPluginFactory.cpp	Thu Nov 03 14:14:09 2016 +0000
+++ b/plugin/PiperVampPluginFactory.cpp	Thu Nov 03 14:57:00 2016 +0000
@@ -54,15 +54,15 @@
     m_servers = hep.getHelperExecutables(serverName);
 
     for (auto n: m_servers) {
-        cerr << "NOTE: PiperVampPluginFactory: Found server: "
-             << n.executable << endl;
+        SVDEBUG << "NOTE: PiperVampPluginFactory: Found server: "
+                << n.executable << endl;
     }
     
     if (m_servers.empty()) {
-        cerr << "NOTE: No Piper Vamp servers found in installation;"
-             << " found none of the following:" << endl;
+        SVDEBUG << "NOTE: No Piper Vamp servers found in installation;"
+                << " found none of the following:" << endl;
         for (auto d: hep.getHelperCandidatePaths(serverName)) {
-            cerr << "NOTE: " << d << endl;
+            SVDEBUG << "NOTE: " << d << endl;
         }
     }
 }
@@ -100,6 +100,7 @@
 
     if (m_origins.find(identifier) == m_origins.end()) {
         cerr << "ERROR: No known server for identifier " << identifier << endl;
+        SVDEBUG << "ERROR: No known server for identifier " << identifier << endl;
         return 0;
     }
     
@@ -170,22 +171,22 @@
     for (const auto &c: candidateLibraries) {
         if (c.helperTag == tag) {
             string soname = QFileInfo(c.libraryPath).baseName().toStdString();
-            cerr << "INFO: For tag \"" << tag << "\" giving library " << soname << endl;
+            SVDEBUG << "INFO: For tag \"" << tag << "\" giving library " << soname << endl;
             from.push_back(soname);
         }
     }
 
     if (from.empty()) {
-        cerr << "PiperVampPluginFactory: No candidate libraries for tag \""
+        SVDEBUG << "PiperVampPluginFactory: No candidate libraries for tag \""
              << tag << "\"";
         if (scan->scanSucceeded()) {
             // we have to assume that they all failed to load (i.e. we
             // exclude them all) rather than sending an empty list
             // (which would mean no exclusions)
-            cerr << ", skipping" << endl;
+            SVDEBUG << ", skipping" << endl;
             return;
         } else {
-            cerr << ", but it seems the scan failed, so bumbling on anyway" << endl;
+            SVDEBUG << ", but it seems the scan failed, so bumbling on anyway" << endl;
         }
     }
     
@@ -210,8 +211,8 @@
         return;
     }
 
-    cerr << "PiperVampPluginFactory: server \"" << executable << "\" lists "
-         << lr.available.size() << " plugin(s)" << endl;
+    SVDEBUG << "PiperVampPluginFactory: server \"" << executable << "\" lists "
+            << lr.available.size() << " plugin(s)" << endl;
 
     for (const auto &pd: lr.available) {