Add configurable per-class log filtering

This commit is contained in:
Yuri Kunde Schlesner 2014-12-06 20:00:08 -02:00
parent 0600e2d8b5
commit 0e0a007a25
11 changed files with 223 additions and 14 deletions

View file

@ -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;

View file

@ -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() {

View file

@ -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
)";
}