diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2014-12-06 23:00:08 +0100 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2014-12-13 05:08:06 +0100 |
commit | 0e0a007a2503d468391004c8ea2faae305232345 (patch) | |
tree | 75feea527bd46aa4c534b77b560c89d538757f7f /src/citra | |
parent | Convert old logging calls to new logging macros (diff) | |
download | yuzu-0e0a007a2503d468391004c8ea2faae305232345.tar yuzu-0e0a007a2503d468391004c8ea2faae305232345.tar.gz yuzu-0e0a007a2503d468391004c8ea2faae305232345.tar.bz2 yuzu-0e0a007a2503d468391004c8ea2faae305232345.tar.lz yuzu-0e0a007a2503d468391004c8ea2faae305232345.tar.xz yuzu-0e0a007a2503d468391004c8ea2faae305232345.tar.zst yuzu-0e0a007a2503d468391004c8ea2faae305232345.zip |
Diffstat (limited to '')
-rw-r--r-- | src/citra/citra.cpp | 5 | ||||
-rw-r--r-- | src/citra/config.cpp | 2 | ||||
-rw-r--r-- | src/citra/default_ini.h | 2 | ||||
-rw-r--r-- | src/citra_qt/config.cpp | 4 | ||||
-rw-r--r-- | src/citra_qt/main.cpp | 12 |
5 files changed, 15 insertions, 10 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index d192428e9..d6e8a4ec7 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -7,6 +7,7 @@ #include "common/common.h" #include "common/logging/text_formatter.h" #include "common/logging/backend.h" +#include "common/logging/filter.h" #include "common/scope_exit.h" #include "core/settings.h" @@ -20,7 +21,8 @@ /// Application entry point int __cdecl main(int argc, char **argv) { std::shared_ptr<Log::Logger> logger = Log::InitGlobalLogger(); - std::thread logging_thread(Log::TextLoggingLoop, logger); + Log::Filter log_filter(Log::Level::Debug); + std::thread logging_thread(Log::TextLoggingLoop, logger, &log_filter); SCOPE_EXIT({ logger->Close(); logging_thread.join(); @@ -32,6 +34,7 @@ int __cdecl main(int argc, char **argv) { } Config config; + log_filter.ParseFilterString(Settings::values.log_filter); std::string boot_filename = argv[1]; EmuWindow_GLFW* emu_window = new EmuWindow_GLFW; diff --git a/src/citra/config.cpp b/src/citra/config.cpp index fe0ebe5a8..92764809e 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -64,7 +64,7 @@ void Config::ReadValues() { Settings::values.use_virtual_sd = glfw_config->GetBoolean("Data Storage", "use_virtual_sd", true); // Miscellaneous - Settings::values.enable_log = glfw_config->GetBoolean("Miscellaneous", "enable_log", true); + Settings::values.log_filter = glfw_config->Get("Miscellaneous", "log_filter", "*:Info"); } void Config::Reload() { diff --git a/src/citra/default_ini.h b/src/citra/default_ini.h index f1f626eed..7cf543e07 100644 --- a/src/citra/default_ini.h +++ b/src/citra/default_ini.h @@ -34,7 +34,7 @@ gpu_refresh_rate = ## 60 (default) use_virtual_sd = [Miscellaneous] -enable_log = +log_filter = *:Info ## Examples: *:Debug Kernel.SVC:Trace Service.*:Critical )"; } 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() { qt_config->endGroup(); qt_config->beginGroup("Miscellaneous"); - Settings::values.enable_log = qt_config->value("enable_log", true).toBool(); + Settings::values.log_filter = qt_config->value("log_filter", "*:Info").toString().toStdString(); qt_config->endGroup(); } @@ -87,7 +87,7 @@ void Config::SaveValues() { qt_config->endGroup(); qt_config->beginGroup("Miscellaneous"); - qt_config->setValue("enable_log", Settings::values.enable_log); + qt_config->setValue("log_filter", QString::fromStdString(Settings::values.log_filter)); qt_config->endGroup(); } 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 @@ #include "common/logging/text_formatter.h" #include "common/logging/log.h" #include "common/logging/backend.h" +#include "common/logging/filter.h" #include "common/platform.h" #include "common/scope_exit.h" @@ -42,14 +43,10 @@ GMainWindow::GMainWindow() { - Pica::g_debug_context = Pica::DebugContext::Construct(); Config config; - if (!Settings::values.enable_log) - LogManager::Shutdown(); - ui.setupUi(this); statusBar()->hide(); @@ -277,7 +274,8 @@ void GMainWindow::closeEvent(QCloseEvent* event) int __cdecl main(int argc, char* argv[]) { std::shared_ptr<Log::Logger> logger = Log::InitGlobalLogger(); - std::thread logging_thread(Log::TextLoggingLoop, logger); + Log::Filter log_filter(Log::Level::Info); + std::thread logging_thread(Log::TextLoggingLoop, logger, &log_filter); SCOPE_EXIT({ logger->Close(); logging_thread.join(); @@ -285,7 +283,11 @@ int __cdecl main(int argc, char* argv[]) QApplication::setAttribute(Qt::AA_X11InitThreads); QApplication app(argc, argv); + GMainWindow main_window; + // After settings have been loaded by GMainWindow, apply the filter + log_filter.ParseFilterString(Settings::values.log_filter); + main_window.show(); return app.exec(); } |