I have a Qt Application and I use qDebug message for my application.
However I have gotten lazy and left in a load of:
#include <QDebug>
in my header files. Should I remove them for a production deployment and what benefit will it give?
You shouldn't remove the header inclusion. If you do so, every statement involving qDebug might give a compiler error.
Instead, define the symbol QT_NO_DEBUG_OUTPUT when compiling for release. qDebug will do nothing when that symbol is defined and (hopefully) the compiler will optimize away the calls to a function that does nothing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With