r3299 - trunk/libmutil/source

erik at minisip.org erik at minisip.org
Mon Jun 11 15:34:50 CEST 2007


Author: erik
Date: 2007-06-11 15:34:49 +0200 (Mon, 11 Jun 2007)
New Revision: 3299

Modified:
   trunk/libmutil/source/MemObject.cxx
   trunk/libmutil/source/MessageRouter.cxx
Log:

 * MessageRouter: There was a cerr that polluted the debug output. Now it's
   mdbg output.

 * MemObject: with debug output enabled we can turn on debug output when
   ever a memory object is created or deleted. It was sent to cerr. Now
   it is sent to mdbg so that it can be filtered, and redirected via the
   callback hook.



Modified: trunk/libmutil/source/MemObject.cxx
===================================================================
--- trunk/libmutil/source/MemObject.cxx	2007-06-11 13:31:33 UTC (rev 3298)
+++ trunk/libmutil/source/MemObject.cxx	2007-06-11 13:34:49 UTC (rev 3299)
@@ -26,6 +26,7 @@
 
 #include<libmutil/MemObject.h>
 #include<libmutil/Mutex.h>
+#include<libmutil/dbg.h>
 #include<string>
 
 #include<typeinfo>
@@ -105,7 +106,7 @@
 	global.unlock();
 	if (refRet==0 && outputOnDestructor){
 		string output = "MO (--):"+getMemObjectType()+ "; count=" + itoa(refRet) + "; ptr=" + itoa((int)this);
-		cerr << output << endl;
+		mdbg("memobject") << output << endl;
 	}
 #else
 	refLock->unlock();
@@ -124,10 +125,9 @@
 	
 #ifdef MDEBUG
 	global.unlock();
-	//if (outputOnDestructor ){
 	if (refCount == 1 && outputOnDestructor ){
 		string output = "MO (++):"+getMemObjectType()+ "; count=" + itoa(refCount);
-		cerr << output << endl;
+		mdbg("memobject") << output << endl;
 	}
 #else
 	refLock->unlock();

Modified: trunk/libmutil/source/MessageRouter.cxx
===================================================================
--- trunk/libmutil/source/MessageRouter.cxx	2007-06-11 13:31:33 UTC (rev 3298)
+++ trunk/libmutil/source/MessageRouter.cxx	2007-06-11 13:34:49 UTC (rev 3299)
@@ -73,12 +73,11 @@
 
 void MessageRouter::handleCommand(string subsystem, const CommandString &cmd){
 #ifdef DEBUG_OUTPUT
-	cerr << "MessageRouter:  To:"<<subsystem<<" Command:"<<cmd.getString()<<endl;
+	mdbg("messagerouter") << "MessageRouter:  To:"<<subsystem<<" Command:"<<cmd.getString()<<endl;
 #endif
 	list<Route>::iterator i;
 	for (i=internal->subsystems.begin(); i!=internal->subsystems.end(); i++){
 		if ((*i).ssname==subsystem){
-			//cerr << "Comparing <"<<subsystem <<"> with <"<<(*i).ssname<<">"<<endl;
 			(*i).dest->handleCommand(subsystem, cmd);
 			return;
 		}
@@ -88,14 +87,14 @@
 
 CommandString MessageRouter::handleCommandResp(string subsystem, const CommandString &cmd){
 #ifdef DEBUG_OUTPUT
-	mdbg << "MessageRouter:  To(request):"<<subsystem<<" Command:"<<cmd.getString()<<endl;
+	mdbg("messagerouter") << "MessageRouter:  To(request):"<<subsystem<<" Command:"<< cmd.getString()<< endl;
 #endif
 	list<Route>::iterator i;
 	for (i=internal->subsystems.begin(); i!=internal->subsystems.end(); i++){
 		if ((*i).ssname==subsystem){
 			CommandString ret =(*i).dest->handleCommandResp(subsystem, cmd);
 #ifdef DEBUG_OUTPUT
-			mdbg << "MessageRouter:  Response from:"<<subsystem<<" Command:"<<ret.getString()<<endl;
+			mdbg("messagerouter") << "MessageRouter:  Response from:"<<subsystem<<" Command:"<<ret.getString()<<endl;
 #endif
 			return ret;
 		}



More information about the Minisip-devel mailing list