aboutsummaryrefslogtreecommitdiffstats
path: root/src/remotesettings
diff options
context:
space:
mode:
authorEgor Nemtsev <enemtsev@luxoft.com>2020-02-21 17:29:29 +0300
committerEgor Nemtsev <enemtsev@luxoft.com>2020-03-03 05:25:31 +0000
commit0a9cfda65c7dbfcf72881e7c33892ff37548a002 (patch)
treec08e76f76910aaa0ff19d59c559240428f6fc2e2 /src/remotesettings
parent01b01dea92ab2d1748a54803e211fae2af207b88 (diff)
[companion] add switchable filter for log messages
- add default app filter to hide all log messages and option "verbose" to restore default behavior Task-number: AUTOSUITE-1493 Change-Id: I1cd26c7ee1e21a815a706b1ef95c1a5b06df901c Reviewed-by: Evgeniy Zabotkin <ezabotkin@luxoft.com> Reviewed-by: Grigorii Zimin <gzimin@luxoft.com>
Diffstat (limited to 'src/remotesettings')
-rw-r--r--src/remotesettings/app/main.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/remotesettings/app/main.cpp b/src/remotesettings/app/main.cpp
index daa26731..fdc99c88 100644
--- a/src/remotesettings/app/main.cpp
+++ b/src/remotesettings/app/main.cpp
@@ -33,6 +33,7 @@
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QDir>
+#include <QtCore/QCommandLineParser>
#include <QtIviCore/QtIviCoreVersion>
#include "client.h"
@@ -43,9 +44,27 @@
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QCoreApplication::setApplicationName(QStringLiteral("Neptune Companion"));
+ QCoreApplication::setOrganizationName(QStringLiteral("Luxoft Sweden AB"));
+ QCoreApplication::setOrganizationDomain(QStringLiteral("luxoft.com"));
QCoreApplication::setApplicationVersion(STR(NEPTUNE_COMPANION_APP_VERSION));
QGuiApplication app(argc, argv);
+ QCommandLineParser cmdParser;
+ cmdParser.setApplicationDescription(
+ "Neptune Companion\n\n"
+ "Logging is turned off by default, to control log output please check command line "
+ "options or Qt Help for QT_LOGGING_RULES environment variable.\n");
+ cmdParser.addHelpOption();
+ cmdParser.addVersionOption();
+ const QCommandLineOption enableDefaultLoggingOption("verbose",
+ "Enables default Qt logging filter.");
+ cmdParser.addOption(enableDefaultLoggingOption);
+ cmdParser.process(app);
+ if (!cmdParser.isSet(enableDefaultLoggingOption)) {
+ QLoggingCategory::setFilterRules("*=false");
+ }
+
Client client;
QQmlApplicationEngine engine;