Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QT_DEBUG and #include <QDebug>
fem_dev last edited by
I would like to know if is a "good pratice" to include <QDebug> only in QT_DEBUG mode. Like
#ifdef QT_DEBUG #include <QDebug> #endif
Or Qt Creator IDE already include the <QDebug> library only in debug mode automatically.
well, its fine if you really want it gone in Release mode.
It's not removed and still active in Release. Creator do not alter includes.
You can do
CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT
in the .pro file
to disable qDebug()
so if you combine that with #ifdef QT_DEBUG
then i guess it would make sense.
This is just my personal opinion and might not be universally accepted
as best practice :)
the very best you can do is to switch to categorized logging.
With that, you can turn on and off the debug messages at runtime, even in a release build and even on your customers machine far away.
Can be a lifesaver ;)
For some reason, the link did not work for me. but it seems correct !?
so just in case:
ODБOï last edited by ODБOï
seems correct !?
yes, same for me
it looks like forum Link feature is broken ?
You are missing the https:// on front of the url.
@LeLev I fixed the link.
ODБOï last edited by
@SGaist true! i fixed also