Fix inline comments and make small logging category logic adjustments
This commit is contained in:
parent
fba096ff0c
commit
b1da5b4327
@ -1,2 +0,0 @@
|
|||||||
[Rules]
|
|
||||||
*.debug=false
|
|
||||||
@ -114,7 +114,7 @@ function copyLogsContent() {
|
|||||||
var logTextArea = document.getElementById("logsTextArea")
|
var logTextArea = document.getElementById("logsTextArea")
|
||||||
|
|
||||||
logTextArea.select();
|
logTextArea.select();
|
||||||
//logTextArea.setSelectionRange(0, 99999); /*For mobile devices*/
|
logTextArea.setSelectionRange(0, 99999); /*For mobile devices*/
|
||||||
document.execCommand("copy");
|
document.execCommand("copy");
|
||||||
|
|
||||||
console.log("Copied text:");
|
console.log("Copied text:");
|
||||||
|
|||||||
@ -174,17 +174,27 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* The logging rules will be evaluated sequentially
|
/* The logging rules will be evaluated sequentially
|
||||||
* 1. All debug categories off
|
* 1. All debug categories off
|
||||||
* 2. The stored categories from the nymead.conf will be appended
|
* 2. Enable all debug categories if requested from command line (-p)
|
||||||
* 3. The Command line parameters will be added (-p and -d)
|
* 3. The stored categories from the nymead.conf will be appended
|
||||||
|
* 4. Add the individual command line params will be added (-d)
|
||||||
* 4. QT_LOGGING_CONF
|
* 4. QT_LOGGING_CONF
|
||||||
* 5. QT_LOGGING_RULES
|
* 5. QT_LOGGING_RULES
|
||||||
*
|
*
|
||||||
* The final filter rules will be set.
|
* The final filter rules will be set.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// 1. All debug categories off
|
||||||
QStringList loggingRules;
|
QStringList loggingRules;
|
||||||
loggingRules << "*.debug=false";
|
loggingRules << "*.debug=false";
|
||||||
// Load the rules from nymead.conf file and append them to the rules
|
|
||||||
|
// 2. Enable all debug categories making sense if requested from command line (-p)
|
||||||
|
if (parser.isSet(allOption)) {
|
||||||
|
loggingRules << "*.debug=true";
|
||||||
|
loggingRules << "*Traffic.debug=false";
|
||||||
|
loggingRules << "*Debug.debug=false";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. The stored categories from the nymead.conf will be appended
|
||||||
NymeaSettings nymeaSettings(NymeaSettings::SettingsRoleGlobal);
|
NymeaSettings nymeaSettings(NymeaSettings::SettingsRoleGlobal);
|
||||||
nymeaSettings.beginGroup("LoggingRules");
|
nymeaSettings.beginGroup("LoggingRules");
|
||||||
foreach (const QString &category, nymeaSettings.childKeys()) {
|
foreach (const QString &category, nymeaSettings.childKeys()) {
|
||||||
@ -192,14 +202,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
nymeaSettings.endGroup();
|
nymeaSettings.endGroup();
|
||||||
|
|
||||||
// Append the rules depending on the application parameter
|
// Add the individual command line params will be added (-d)
|
||||||
if (parser.isSet(allOption)) {
|
|
||||||
loggingRules << "*.debug=true";
|
|
||||||
loggingRules << "*Traffic.debug=false";
|
|
||||||
loggingRules << "*Debug.debug=false";
|
|
||||||
}
|
|
||||||
|
|
||||||
// And allow overriding individual values with application parameter
|
|
||||||
foreach (QString debugArea, parser.values(debugOption)) {
|
foreach (QString debugArea, parser.values(debugOption)) {
|
||||||
bool enable = !debugArea.startsWith("No");
|
bool enable = !debugArea.startsWith("No");
|
||||||
bool isWarning = debugArea.endsWith("Warnings");
|
bool isWarning = debugArea.endsWith("Warnings");
|
||||||
@ -212,6 +215,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Finally set the rules for the logging
|
||||||
QLoggingCategory::setFilterRules(loggingRules.join('\n'));
|
QLoggingCategory::setFilterRules(loggingRules.join('\n'));
|
||||||
|
|
||||||
// Parse DBus option
|
// Parse DBus option
|
||||||
|
|||||||
Reference in New Issue
Block a user