summaryrefslogtreecommitdiff
path: root/src/citra_qt
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2014-12-06 20:00:08 -0200
committerGravatar Yuri Kunde Schlesner2014-12-13 02:08:06 -0200
commit0e0a007a2503d468391004c8ea2faae305232345 (patch)
tree75feea527bd46aa4c534b77b560c89d538757f7f /src/citra_qt
parentConvert old logging calls to new logging macros (diff)
downloadyuzu-0e0a007a2503d468391004c8ea2faae305232345.tar.gz
yuzu-0e0a007a2503d468391004c8ea2faae305232345.tar.xz
yuzu-0e0a007a2503d468391004c8ea2faae305232345.zip
Add configurable per-class log filtering
Diffstat (limited to 'src/citra_qt')
-rw-r--r--src/citra_qt/config.cpp4
-rw-r--r--src/citra_qt/main.cpp12
2 files changed, 9 insertions, 7 deletions
diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp
index 3209e5900..0ae6b8b2d 100644
--- a/src/citra_qt/config.cpp
+++ b/src/citra_qt/config.cpp
@@ -52,7 +52,7 @@ void Config::ReadValues() {
52 qt_config->endGroup(); 52 qt_config->endGroup();
53 53
54 qt_config->beginGroup("Miscellaneous"); 54 qt_config->beginGroup("Miscellaneous");
55 Settings::values.enable_log = qt_config->value("enable_log", true).toBool(); 55 Settings::values.log_filter = qt_config->value("log_filter", "*:Info").toString().toStdString();
56 qt_config->endGroup(); 56 qt_config->endGroup();
57} 57}
58 58
@@ -87,7 +87,7 @@ void Config::SaveValues() {
87 qt_config->endGroup(); 87 qt_config->endGroup();
88 88
89 qt_config->beginGroup("Miscellaneous"); 89 qt_config->beginGroup("Miscellaneous");
90 qt_config->setValue("enable_log", Settings::values.enable_log); 90 qt_config->setValue("log_filter", QString::fromStdString(Settings::values.log_filter));
91 qt_config->endGroup(); 91 qt_config->endGroup();
92} 92}
93 93
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 5293263cd..817732167 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -11,6 +11,7 @@
11#include "common/logging/text_formatter.h" 11#include "common/logging/text_formatter.h"
12#include "common/logging/log.h" 12#include "common/logging/log.h"
13#include "common/logging/backend.h" 13#include "common/logging/backend.h"
14#include "common/logging/filter.h"
14#include "common/platform.h" 15#include "common/platform.h"
15#include "common/scope_exit.h" 16#include "common/scope_exit.h"
16 17
@@ -42,14 +43,10 @@
42 43
43GMainWindow::GMainWindow() 44GMainWindow::GMainWindow()
44{ 45{
45
46 Pica::g_debug_context = Pica::DebugContext::Construct(); 46 Pica::g_debug_context = Pica::DebugContext::Construct();
47 47
48 Config config; 48 Config config;
49 49
50 if (!Settings::values.enable_log)
51 LogManager::Shutdown();
52
53 ui.setupUi(this); 50 ui.setupUi(this);
54 statusBar()->hide(); 51 statusBar()->hide();
55 52
@@ -277,7 +274,8 @@ void GMainWindow::closeEvent(QCloseEvent* event)
277int __cdecl main(int argc, char* argv[]) 274int __cdecl main(int argc, char* argv[])
278{ 275{
279 std::shared_ptr<Log::Logger> logger = Log::InitGlobalLogger(); 276 std::shared_ptr<Log::Logger> logger = Log::InitGlobalLogger();
280 std::thread logging_thread(Log::TextLoggingLoop, logger); 277 Log::Filter log_filter(Log::Level::Info);
278 std::thread logging_thread(Log::TextLoggingLoop, logger, &log_filter);
281 SCOPE_EXIT({ 279 SCOPE_EXIT({
282 logger->Close(); 280 logger->Close();
283 logging_thread.join(); 281 logging_thread.join();
@@ -285,7 +283,11 @@ int __cdecl main(int argc, char* argv[])
285 283
286 QApplication::setAttribute(Qt::AA_X11InitThreads); 284 QApplication::setAttribute(Qt::AA_X11InitThreads);
287 QApplication app(argc, argv); 285 QApplication app(argc, argv);
286
288 GMainWindow main_window; 287 GMainWindow main_window;
288 // After settings have been loaded by GMainWindow, apply the filter
289 log_filter.ParseFilterString(Settings::values.log_filter);
290
289 main_window.show(); 291 main_window.show();
290 return app.exec(); 292 return app.exec();
291} 293}