Implement "--verbose" for printing qInfo() and console.info() messages

This commit is contained in:
Matti Viljanen 2020-03-23 04:14:30 +02:00
parent f669ec6dec
commit 84728c0910
No known key found for this signature in database
GPG key ID: CF32A1495158F888

View file

@ -50,9 +50,12 @@ int main(int argc, char *argv[])
std::cout << "Battery Buddy " << APP_VERSION << std::endl << std::flush; std::cout << "Battery Buddy " << APP_VERSION << std::endl << std::flush;
return 0; return 0;
} }
else if(!strcmp(argv[i],"--verbose"))
qputenv(logEnvVar, "*.info=true;*.debug=false");
} }
if(!qEnvironmentVariableIsSet(logEnvVar))
qputenv(logEnvVar, "*.info=false;*.debug=false");
qInfo() << "Starting Battery Buddy...";
QGuiApplication* app = SailfishApp::application(argc, argv); QGuiApplication* app = SailfishApp::application(argc, argv);
QQuickView* view = SailfishApp::createView(); QQuickView* view = SailfishApp::createView();