Implement "--debug" to print qInfo(), qDebug(), console.info() and console.debug() messages
Note that setting "*.debug=true" leads the whole Qt's debug output being printed, which is NOT recommened.
This commit is contained in:
parent
84728c0910
commit
6c436c3c12
2 changed files with 5 additions and 3 deletions
|
@ -21,6 +21,9 @@ VERSION = $${VER}-$${REL}
|
|||
$$system(bash update-spec-version.sh $$TARGET $$VER $$REL)
|
||||
DEFINES += APP_VERSION=\"\\\"$$VERSION\\\"\"
|
||||
|
||||
# Do not set this! Use "--verbose" and "--debug" instead.
|
||||
#DEFINES += QT_NO_DEBUG_OUTPUT
|
||||
|
||||
HEADERS += \
|
||||
src/battery.h \
|
||||
src/settings.h
|
||||
|
|
|
@ -52,6 +52,8 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
else if(!strcmp(argv[i],"--verbose"))
|
||||
qputenv(logEnvVar, "*.info=true;*.debug=false");
|
||||
else if(!strcmp(argv[i],"--debug"))
|
||||
qputenv(logEnvVar, "*.info=true");
|
||||
}
|
||||
if(!qEnvironmentVariableIsSet(logEnvVar))
|
||||
qputenv(logEnvVar, "*.info=false;*.debug=false");
|
||||
|
@ -60,9 +62,6 @@ int main(int argc, char *argv[])
|
|||
QGuiApplication* app = SailfishApp::application(argc, argv);
|
||||
QQuickView* view = SailfishApp::createView();
|
||||
|
||||
qDebug() << "Application name:" << app->applicationName();
|
||||
qDebug() << "Organization name:" << app->organizationName();
|
||||
|
||||
Settings* settings = new Settings();
|
||||
Battery* battery = new Battery(settings);
|
||||
|
||||
|
|
Loading…
Reference in a new issue