mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-04-26 17:54:40 +00:00
Output all the working options and their value
At the debug verbose level (-verbose 3) only.
This commit is contained in:
parent
7b978a5561
commit
647055ec21
25
params.cpp
25
params.cpp
@ -247,9 +247,34 @@ bool Params::parseParams(const QStringList ¶msArray) {
|
||||
}
|
||||
}
|
||||
|
||||
printWorkingOptions();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Params::printWorkingOptions() {
|
||||
QuasarAppUtils::Params::log("--- Working options table start ---",
|
||||
QuasarAppUtils::Debug);
|
||||
|
||||
QVariantMap::const_iterator iter = params.constBegin();
|
||||
while (iter != params.constEnd()) {
|
||||
|
||||
QString row = QString{"Option[%0]"}.arg(iter.key());
|
||||
|
||||
QString value = iter.value().toString();
|
||||
if (!value.isEmpty()) {
|
||||
row += QString{": %1"}.arg(value);
|
||||
}
|
||||
|
||||
QuasarAppUtils::Params::log(row, QuasarAppUtils::Debug);
|
||||
|
||||
++iter;
|
||||
}
|
||||
|
||||
QuasarAppUtils::Params::log("--- Working options table end ---",
|
||||
QuasarAppUtils::Debug);
|
||||
}
|
||||
|
||||
QString Params::getStrArg(const QString& key, const QString &def) {
|
||||
return params.value(key, def).toString();
|
||||
}
|
||||
|
7
params.h
7
params.h
@ -40,6 +40,13 @@ private:
|
||||
static std::string lvlToString(VerboseLvl vLvl);
|
||||
static bool writeLoginFile(const QString& log, VerboseLvl vLvl = VerboseLvl::Debug);
|
||||
|
||||
/**
|
||||
* @brief Traverse @a params and output its content (all the working
|
||||
* options) to stdout in the form of option-value groups at the
|
||||
* debug verbose level (-verbose 3).
|
||||
*/
|
||||
static void printWorkingOptions();
|
||||
|
||||
public:
|
||||
Params() = delete;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user