From: Michal H. <ms...@gm...> - 2008-04-05 16:04:56
|
changeDebugLevel needs update because message about change is printed only when the level is set above DBG_INFO because debugLevel is set before it. This is fixed by setting level to DBG_INFO just for this message. changeDebugLevel - sets debugLevel to DBG_INFO before message printed and the real value is set immediately after Index: pdfedit-patches/src/utils/debug.cc =================================================================== --- pdfedit-patches.orig/src/utils/debug.cc 2008-04-05 17:01:28.000000000 +0200 +++ pdfedit-patches/src/utils/debug.cc 2008-04-05 17:04:54.000000000 +0200 @@ -43,11 +43,14 @@ unsigned int changeDebugLevel(unsigned i { // gets an old value and sets new unsigned int oldLevel=debugLevel; - debugLevel=level; // logs change of level with DEBUG prefix to default output stream + // temporarily sets debugLevel so that message is guaranteed to + // be printed + debugLevel=DBG_INFO; printDbg(DEBUG_PREFIX, DBG_INFO, "debugLevel has changed from "<<oldLevel<<" to "<<level); + debugLevel=level; return oldLevel; } -- Michal Hocko |