diff PyPlugin.cpp @ 67:146d14ab15e7

Debug output: off by default, on with VAMPY_VERBOSE environment variable
author Chris Cannam
date Mon, 17 Nov 2014 10:03:44 +0000
parents 5664fe298af2
children 40a01bb24209 f92587bedb2c
line wrap: on
line diff
--- a/PyPlugin.cpp	Mon Nov 17 09:37:59 2014 +0000
+++ b/PyPlugin.cpp	Mon Nov 17 10:03:44 2014 +0000
@@ -14,7 +14,7 @@
 #include "PyTypeInterface.h"
 #include <stdlib.h>
 #include "PyExtensionModule.h"
-
+#include "Debug.h"
 
 #ifdef _WIN32
 #define PATHSEP ('\\')
@@ -50,7 +50,7 @@
 {	
 	m_ti.setInputSampleRate(inputSampleRate);
 	MutexLocker locker(&m_pythonInterpreterMutex);
-	cerr << "Creating instance " << m_instcount << " of " << pluginKey << endl;
+	DSTREAM << "Creating instance " << m_instcount << " of " << pluginKey << endl;
 		
 	// Create an instance
 	Py_INCREF(m_pyClass);
@@ -82,7 +82,7 @@
 	m_useRealTimeFlag = (bool) (m_vampyFlags & vf_REALTIME);
 		
 	if (m_debugFlag) cerr << "Debug messages ON for Vampy plugin: " << m_class << endl;
-	else cerr << "Debug messages OFF for Vampy plugin: " << m_class << endl;
+	else DSTREAM << "Debug messages OFF for Vampy plugin: " << m_class << endl;
 	
 	if (m_debugFlag && m_quitOnErrorFlag) cerr << "Quit on type error ON for: " << m_class << endl;
    
@@ -103,9 +103,7 @@
 	if (m_pyClass) Py_DECREF(m_pyClass); 
 	if (m_pyProcess) Py_CLEAR(m_pyProcess);
 
-#ifdef _DEBUG
-	cerr << "PyPlugin::PyPlugin:" << m_class << " instance " << m_instcount << " deleted." << endl;
-#endif
+	DSTREAM << "PyPlugin::PyPlugin:" << m_class << " instance " << m_instcount << " deleted." << endl;
 }
 
 string