diff plugin/PluginScan.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 d45a16c232bd
line wrap: on
line diff
--- a/plugin/PluginScan.cpp	Thu Nov 03 14:14:09 2016 +0000
+++ b/plugin/PluginScan.cpp	Thu Nov 03 14:57:00 2016 +0000
@@ -25,15 +25,10 @@
 
 using std::string;
 
-//#define DEBUG_PLUGIN_SCAN 1
-
 class PluginScan::Logger : public PluginCandidates::LogCallback
 {
 protected:
     void log(std::string message) {
-#ifdef DEBUG_PLUGIN_SCAN
-        cerr << "PluginScan: " << message;
-#endif
         SVDEBUG << "PluginScan: " << message;
     }
 };
@@ -74,14 +69,14 @@
     clear();
 
     for (auto p: helpers) {
-        cerr << "NOTE: PluginScan: Found helper: " << p.executable << endl;
+        SVDEBUG << "NOTE: PluginScan: Found helper: " << p.executable << endl;
     }
     
     if (helpers.empty()) {
-        cerr << "NOTE: No plugin checker helpers found in installation;"
+        SVDEBUG << "NOTE: No plugin checker helpers found in installation;"
              << " found none of the following:" << endl;
         for (auto d: hep.getHelperCandidatePaths(helperName)) {
-            cerr << "NOTE: " << d << endl;
+            SVDEBUG << "NOTE: " << d << endl;
         }
     }
 
@@ -90,14 +85,14 @@
             KnownPlugins *kp = new KnownPlugins
                 (p.executable.toStdString(), m_logger);
             if (m_kp.find(p.tag) != m_kp.end()) {
-                cerr << "WARNING: PluginScan::scan: Duplicate tag " << p.tag
+                SVDEBUG << "WARNING: PluginScan::scan: Duplicate tag " << p.tag
                      << " for helpers" << endl;
                 continue;
             }
             m_kp[p.tag] = kp;
             m_succeeded = true;
         } catch (const std::exception &e) {
-            cerr << "ERROR: PluginScan::scan: " << e.what()
+            SVDEBUG << "ERROR: PluginScan::scan: " << e.what()
                  << " (with helper path = " << p.executable << ")" << endl;
         }
     }
@@ -141,9 +136,9 @@
         
         auto c = kp->getCandidateLibrariesFor(kpt);
 
-        std::cerr << "PluginScan: helper \"" << kp->getHelperExecutableName()
-                  << "\" likes " << c.size() << " libraries of type "
-                  << kp->getTagFor(kpt) << std::endl;
+        SVDEBUG << "PluginScan: helper \"" << kp->getHelperExecutableName()
+                << "\" likes " << c.size() << " libraries of type "
+                << kp->getTagFor(kpt) << endl;
 
         for (auto s: c) {
             candidates.push_back({ s.c_str(), rec.first });