mirror of
https://github.com/status-im/status-react.git
synced 2025-01-09 18:46:19 +00:00
9bc98405a0
Add section separator for logging-display Refactor user-login-callback Add comment to AppConfig class definition Fix mobile compilation error Use reference in AppConfig singleton; remove obsolete CMake directives Styling changes Disable status-go logs by default on desktop Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
#include "appconfig.h"
|
|
|
|
#include <QLoggingCategory>
|
|
|
|
|
|
const QStringList loggingCategories =
|
|
{"UIManager",
|
|
"Flexbox",
|
|
"WebSocketModule",
|
|
"Networking",
|
|
"ViewManager",
|
|
"RCTNotification",
|
|
"default",
|
|
"RCTStatus",
|
|
"jsserver",
|
|
"status"};
|
|
Q_LOGGING_CATEGORY(APPCONFIG, "AppConfig")
|
|
|
|
AppConfig AppConfig::appConfig;
|
|
|
|
AppConfig::AppConfig() {
|
|
}
|
|
|
|
AppConfig& AppConfig::inst() {
|
|
return appConfig;
|
|
}
|
|
|
|
bool AppConfig::getLoggingEnabled() const {
|
|
return loggingEnabled;
|
|
}
|
|
|
|
void AppConfig::setLoggingEnabled(bool enabled) {
|
|
//qCDebug(APPCONFIG) << "### appconfig setLoggingEnabled " << enabled;
|
|
QLoggingCategory::setFilterRules(getLoggingFilterRules(enabled));
|
|
this->loggingEnabled = enabled;
|
|
}
|
|
|
|
QString AppConfig::getLoggingFilterRules(bool enabled) const {
|
|
if (enabled) {
|
|
return "UIManager=false\nFlexbox=false\nViewManager=false\nNetworking=false\nWebSocketModule=false";
|
|
}
|
|
else {
|
|
QString filterRules;
|
|
for (int i = 0; i < loggingCategories.size(); ++i) {
|
|
filterRules += (loggingCategories.at(i) + "=false\n");
|
|
}
|
|
return filterRules;
|
|
}
|
|
}
|