mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 03:48:38 +02:00
Add --logOptions to domain server and assignment client
This commit is contained in:
parent
2a919e35f4
commit
4204056f2e
2 changed files with 24 additions and 0 deletions
|
@ -107,6 +107,9 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) :
|
||||||
const QCommandLineOption parentPIDOption(PARENT_PID_OPTION, "PID of the parent process", "parent-pid");
|
const QCommandLineOption parentPIDOption(PARENT_PID_OPTION, "PID of the parent process", "parent-pid");
|
||||||
parser.addOption(parentPIDOption);
|
parser.addOption(parentPIDOption);
|
||||||
|
|
||||||
|
const QCommandLineOption logOption("logOptions", "Logging options, comma separated: color,nocolor,process_id,thread_id,milliseconds,keep_repeats,journald,nojournald", "options");
|
||||||
|
parser.addOption(logOption);
|
||||||
|
|
||||||
if (!parser.parse(QCoreApplication::arguments())) {
|
if (!parser.parse(QCoreApplication::arguments())) {
|
||||||
std::cout << parser.errorText().toStdString() << std::endl; // Avoid Qt log spam
|
std::cout << parser.errorText().toStdString() << std::endl; // Avoid Qt log spam
|
||||||
parser.showHelp();
|
parser.showHelp();
|
||||||
|
@ -123,6 +126,15 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) :
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We want to configure the logging system as early as possible
|
||||||
|
auto &logHandler = LogHandler::getInstance();
|
||||||
|
if (parser.isSet(logOption)) {
|
||||||
|
if (!logHandler.parseOptions(parser.value(logOption).toUtf8())) {
|
||||||
|
parser.showHelp();
|
||||||
|
Q_UNREACHABLE();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const QVariantMap argumentVariantMap = HifiConfigVariantMap::mergeCLParametersWithJSONConfig(arguments());
|
const QVariantMap argumentVariantMap = HifiConfigVariantMap::mergeCLParametersWithJSONConfig(arguments());
|
||||||
|
|
||||||
unsigned int numForks = 0;
|
unsigned int numForks = 0;
|
||||||
|
|
|
@ -414,6 +414,9 @@ void DomainServer::parseCommandLine(int argc, char* argv[]) {
|
||||||
const QCommandLineOption parentPIDOption(PARENT_PID_OPTION, "PID of the parent process", "parent-pid");
|
const QCommandLineOption parentPIDOption(PARENT_PID_OPTION, "PID of the parent process", "parent-pid");
|
||||||
parser.addOption(parentPIDOption);
|
parser.addOption(parentPIDOption);
|
||||||
|
|
||||||
|
const QCommandLineOption logOption("logOptions", "Logging options, comma separated: color,nocolor,process_id,thread_id,milliseconds,keep_repeats,journald,nojournald", "options");
|
||||||
|
parser.addOption(logOption);
|
||||||
|
|
||||||
|
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
for (int i = 0; i < argc; ++i) {
|
for (int i = 0; i < argc; ++i) {
|
||||||
|
@ -436,6 +439,15 @@ void DomainServer::parseCommandLine(int argc, char* argv[]) {
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We want to configure the logging system as early as possible
|
||||||
|
auto &logHandler = LogHandler::getInstance();
|
||||||
|
if (parser.isSet(logOption)) {
|
||||||
|
if (!logHandler.parseOptions(parser.value(logOption).toUtf8())) {
|
||||||
|
parser.showHelp();
|
||||||
|
Q_UNREACHABLE();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (parser.isSet(iceServerAddressOption)) {
|
if (parser.isSet(iceServerAddressOption)) {
|
||||||
// parse the IP and port combination for this target
|
// parse the IP and port combination for this target
|
||||||
QString hostnamePortString = parser.value(iceServerAddressOption);
|
QString hostnamePortString = parser.value(iceServerAddressOption);
|
||||||
|
|
Loading…
Reference in a new issue