Solved is there any way to switch off qDebug() messages from command line ?
-
Hi,
What is the best way to switch on / off (print shell or not) qDebug() messages ? can we do this as and argument when we starting to application ?
Best
-
Hi
Im not sure there is a commandline as i have only seen compile time switch.
However, you can use
https://doc.qt.io/qt-5/qtglobal.html#qInstallMessageHandler
and add a variable to control if you print it or not. -
@RahibeMeryem You can switch off all debug string with enviroment variable
QT_LOGGING_RULES
.QT_LOGGING_RULES="*.debug=false;"
Then start your application.
You can do this in batch / shell script before starting your application. Or in application with adding:qputenv("QT_LOGGING_RULES", "*.debug=false;");
-
@KroMignon thanks a lot working like a charm..
Best