I used qDebug throughout the code. Now I would like to limit its output to translation units, defining a separate macro to enable / disable qDebug output in the translation block:
test.pro:
DEFINES += NO_DEBUG_ONE
testone.cpp:
#ifdef NO_DEBUG_ONE
#define QT_NO_DEBUG_OUTPUT
#endif
testtwo.cpp:
#ifdef NO_DEBUG_TWO
#define QT_NO_DEBUG_OUTPUT
#endif
So by asking macros like this, I expected to get qDebug output only in testtwo.cpp, but I see qDebug messages from both translation units.
What am I missing here and how to solve it?
source
share