mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-04 06:03:21 +02:00
debug: add command-line option to mute daemon logging
Note: other parts of the client, lrc, daemon, and scripts, use muteDring still and should be changed to something more generic. Change-Id: If9253d6bd8d53f379bc9d5209b49b0c3af92edc2
This commit is contained in:
parent
6ddbce1506
commit
41138a9682
2 changed files with 18 additions and 20 deletions
|
@ -73,6 +73,7 @@ constexpr static const char DEBUG[] = "DEBUG";
|
||||||
constexpr static const char DEBUGCONSOLE[] = "DEBUGCONSOLE";
|
constexpr static const char DEBUGCONSOLE[] = "DEBUGCONSOLE";
|
||||||
constexpr static const char DEBUGFILE[] = "DEBUGFILE";
|
constexpr static const char DEBUGFILE[] = "DEBUGFILE";
|
||||||
constexpr static const char UPDATEURL[] = "UPDATEURL";
|
constexpr static const char UPDATEURL[] = "UPDATEURL";
|
||||||
|
constexpr static const char MUTEDAEMON[] = "MUTEDAEMON";
|
||||||
} // namespace opts
|
} // namespace opts
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -203,7 +204,9 @@ MainApplication::init()
|
||||||
gnutls_global_init();
|
gnutls_global_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
initLrc(results[opts::UPDATEURL].toString(), connectivityMonitor_.get());
|
initLrc(results[opts::UPDATEURL].toString(),
|
||||||
|
connectivityMonitor_.get(),
|
||||||
|
results[opts::MUTEDAEMON].toBool());
|
||||||
|
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX
|
||||||
GlobalInstances::setDBusErrorHandler(std::make_unique<Interfaces::DBusErrorHandler>());
|
GlobalInstances::setDBusErrorHandler(std::make_unique<Interfaces::DBusErrorHandler>());
|
||||||
|
@ -326,7 +329,7 @@ MainApplication::loadTranslations()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MainApplication::initLrc(const QString& downloadUrl, ConnectivityMonitor* cm)
|
MainApplication::initLrc(const QString& downloadUrl, ConnectivityMonitor* cm, bool muteDaemon)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Init mainwindow and finish splash when mainwindow shows up.
|
* Init mainwindow and finish splash when mainwindow shows up.
|
||||||
|
@ -349,7 +352,8 @@ MainApplication::initLrc(const QString& downloadUrl, ConnectivityMonitor* cm)
|
||||||
isMigrating = false;
|
isMigrating = false;
|
||||||
},
|
},
|
||||||
downloadUrl,
|
downloadUrl,
|
||||||
cm));
|
cm,
|
||||||
|
muteDaemon));
|
||||||
lrcInstance_->subscribeToDebugReceived();
|
lrcInstance_->subscribeToDebugReceived();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,34 +374,26 @@ MainApplication::parseArguments()
|
||||||
"port");
|
"port");
|
||||||
parser.addOption(webDebugOption);
|
parser.addOption(webDebugOption);
|
||||||
|
|
||||||
QCommandLineOption minimizedOption(QStringList() << "m"
|
QCommandLineOption minimizedOption({"m", "minimized"}, "Start minimized.");
|
||||||
<< "minimized",
|
|
||||||
"Start minimized.");
|
|
||||||
parser.addOption(minimizedOption);
|
parser.addOption(minimizedOption);
|
||||||
|
|
||||||
QCommandLineOption debugOption(QStringList() << "d"
|
QCommandLineOption debugOption({"d", "debug"}, "Debug out.");
|
||||||
<< "debug",
|
|
||||||
"Debug out.");
|
|
||||||
parser.addOption(debugOption);
|
parser.addOption(debugOption);
|
||||||
|
|
||||||
#ifdef Q_OS_WINDOWS
|
#ifdef Q_OS_WINDOWS
|
||||||
QCommandLineOption debugConsoleOption(QStringList() << "c"
|
QCommandLineOption debugConsoleOption({"c", "console"}, "Debug out to IDE console.");
|
||||||
<< "console",
|
|
||||||
"Debug out to IDE console.");
|
|
||||||
parser.addOption(debugConsoleOption);
|
parser.addOption(debugConsoleOption);
|
||||||
|
|
||||||
QCommandLineOption debugFileOption(QStringList() << "f"
|
QCommandLineOption debugFileOption({"f", "file"}, "Debug to file.");
|
||||||
<< "file",
|
|
||||||
"Debug to file.");
|
|
||||||
parser.addOption(debugFileOption);
|
parser.addOption(debugFileOption);
|
||||||
|
|
||||||
QCommandLineOption updateUrlOption(QStringList() << "u"
|
QCommandLineOption updateUrlOption({"u", "url"}, "<url> for debugging version queries.", "url");
|
||||||
<< "url",
|
|
||||||
"Reference <url> for client versioning.",
|
|
||||||
"url");
|
|
||||||
parser.addOption(updateUrlOption);
|
parser.addOption(updateUrlOption);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
QCommandLineOption muteDaemonOption({"q", "quiet"}, "Mute daemon logging.");
|
||||||
|
parser.addOption(muteDaemonOption);
|
||||||
|
|
||||||
parser.process(*this);
|
parser.process(*this);
|
||||||
|
|
||||||
results[opts::STARTMINIMIZED] = parser.isSet(minimizedOption);
|
results[opts::STARTMINIMIZED] = parser.isSet(minimizedOption);
|
||||||
|
@ -407,6 +403,8 @@ MainApplication::parseArguments()
|
||||||
results[opts::DEBUGFILE] = parser.isSet(debugFileOption);
|
results[opts::DEBUGFILE] = parser.isSet(debugFileOption);
|
||||||
results[opts::UPDATEURL] = parser.value(updateUrlOption);
|
results[opts::UPDATEURL] = parser.value(updateUrlOption);
|
||||||
#endif
|
#endif
|
||||||
|
results[opts::MUTEDAEMON] = parser.isSet(muteDaemonOption);
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ private:
|
||||||
void fileDebug(QFile* debugFile);
|
void fileDebug(QFile* debugFile);
|
||||||
|
|
||||||
void loadTranslations();
|
void loadTranslations();
|
||||||
void initLrc(const QString& downloadUrl, ConnectivityMonitor* cm);
|
void initLrc(const QString& downloadUrl, ConnectivityMonitor* cm, bool muteDaemon);
|
||||||
const QVariantMap parseArguments();
|
const QVariantMap parseArguments();
|
||||||
void setApplicationFont();
|
void setApplicationFont();
|
||||||
void initQmlLayer();
|
void initQmlLayer();
|
||||||
|
|
Loading…
Add table
Reference in a new issue