diff options
| author | 2014-12-06 20:00:08 -0200 | |
|---|---|---|
| committer | 2014-12-13 02:08:06 -0200 | |
| commit | 0e0a007a2503d468391004c8ea2faae305232345 (patch) | |
| tree | 75feea527bd46aa4c534b77b560c89d538757f7f /src/citra | |
| parent | Convert old logging calls to new logging macros (diff) | |
| download | yuzu-0e0a007a2503d468391004c8ea2faae305232345.tar.gz yuzu-0e0a007a2503d468391004c8ea2faae305232345.tar.xz yuzu-0e0a007a2503d468391004c8ea2faae305232345.zip | |
Add configurable per-class log filtering
Diffstat (limited to 'src/citra')
| -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 |
3 files changed, 6 insertions, 3 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 @@ | |||
| 7 | #include "common/common.h" | 7 | #include "common/common.h" |
| 8 | #include "common/logging/text_formatter.h" | 8 | #include "common/logging/text_formatter.h" |
| 9 | #include "common/logging/backend.h" | 9 | #include "common/logging/backend.h" |
| 10 | #include "common/logging/filter.h" | ||
| 10 | #include "common/scope_exit.h" | 11 | #include "common/scope_exit.h" |
| 11 | 12 | ||
| 12 | #include "core/settings.h" | 13 | #include "core/settings.h" |
| @@ -20,7 +21,8 @@ | |||
| 20 | /// Application entry point | 21 | /// Application entry point |
| 21 | int __cdecl main(int argc, char **argv) { | 22 | int __cdecl main(int argc, char **argv) { |
| 22 | std::shared_ptr<Log::Logger> logger = Log::InitGlobalLogger(); | 23 | std::shared_ptr<Log::Logger> logger = Log::InitGlobalLogger(); |
| 23 | std::thread logging_thread(Log::TextLoggingLoop, logger); | 24 | Log::Filter log_filter(Log::Level::Debug); |
| 25 | std::thread logging_thread(Log::TextLoggingLoop, logger, &log_filter); | ||
| 24 | SCOPE_EXIT({ | 26 | SCOPE_EXIT({ |
| 25 | logger->Close(); | 27 | logger->Close(); |
| 26 | logging_thread.join(); | 28 | logging_thread.join(); |
| @@ -32,6 +34,7 @@ int __cdecl main(int argc, char **argv) { | |||
| 32 | } | 34 | } |
| 33 | 35 | ||
| 34 | Config config; | 36 | Config config; |
| 37 | log_filter.ParseFilterString(Settings::values.log_filter); | ||
| 35 | 38 | ||
| 36 | std::string boot_filename = argv[1]; | 39 | std::string boot_filename = argv[1]; |
| 37 | EmuWindow_GLFW* emu_window = new EmuWindow_GLFW; | 40 | 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() { | |||
| 64 | Settings::values.use_virtual_sd = glfw_config->GetBoolean("Data Storage", "use_virtual_sd", true); | 64 | Settings::values.use_virtual_sd = glfw_config->GetBoolean("Data Storage", "use_virtual_sd", true); |
| 65 | 65 | ||
| 66 | // Miscellaneous | 66 | // Miscellaneous |
| 67 | Settings::values.enable_log = glfw_config->GetBoolean("Miscellaneous", "enable_log", true); | 67 | Settings::values.log_filter = glfw_config->Get("Miscellaneous", "log_filter", "*:Info"); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | void Config::Reload() { | 70 | 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) | |||
| 34 | use_virtual_sd = | 34 | use_virtual_sd = |
| 35 | 35 | ||
| 36 | [Miscellaneous] | 36 | [Miscellaneous] |
| 37 | enable_log = | 37 | log_filter = *:Info ## Examples: *:Debug Kernel.SVC:Trace Service.*:Critical |
| 38 | )"; | 38 | )"; |
| 39 | 39 | ||
| 40 | } | 40 | } |