diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2017-06-13 14:30:53 +0200 |
|---|---|---|
| committer | Léo Lam <leo@innovatetechnologi.es> | 2017-06-17 10:20:30 +0200 |
| commit | 100c433261c3b7ae4ee3ece3cbaf0cbfbba584e8 (patch) | |
| tree | ddd55443bd76c63e635fc5cecdbc3b5f05a1d929 /Source/Core/Common/Logging/LogManager.cpp | |
| parent | 10beb2aea1f9a0ea6728a2905bbaf9ea1d7c931d (diff) | |
Logging: Move verbosity setting code to LogManager
No clue why it was in DolphinWX.
Diffstat (limited to 'Source/Core/Common/Logging/LogManager.cpp')
| -rw-r--r-- | Source/Core/Common/Logging/LogManager.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/Core/Common/Logging/LogManager.cpp b/Source/Core/Common/Logging/LogManager.cpp index 2c09bc5051..b982509090 100644 --- a/Source/Core/Common/Logging/LogManager.cpp +++ b/Source/Core/Common/Logging/LogManager.cpp @@ -103,11 +103,22 @@ LogManager::LogManager() options->Get("WriteToFile", &write_file, false); options->Get("WriteToConsole", &write_console, true); + // Set up log listeners + int verbosity; + options->Get("Verbosity", &verbosity, 0); + + // Ensure the verbosity level is valid + if (verbosity < 1) + verbosity = 1; + if (verbosity > MAX_LOGLEVEL) + verbosity = MAX_LOGLEVEL; + for (LogContainer* container : m_Log) { bool enable; logs->Get(container->GetShortName(), &enable, false); container->SetEnable(enable); + container->SetLevel(static_cast<LogTypes::LOG_LEVELS>(verbosity)); if (enable && write_file) container->AddListener(LogListener::FILE_LISTENER); if (enable && write_console) |
