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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.