diff options
| author | Rachel Bryk <RachelBryk@gmail.com> | 2014-09-03 19:48:54 -0400 |
|---|---|---|
| committer | Rachel Bryk <RachelBryk@gmail.com> | 2014-09-03 19:50:02 -0400 |
| commit | 22d2c7d0533bf7b82163e452f536647b0bb32c66 (patch) | |
| tree | 676cc61bfc9fb7ef0b1b70c7a949996f0ceb1395 /Source/Core/Common/Logging/LogManager.cpp | |
| parent | 6e2b873ec1f5c4c404925b9dfbde863fbaec7102 (diff) | |
Read the config file before enabling logs.
Diffstat (limited to 'Source/Core/Common/Logging/LogManager.cpp')
| -rw-r--r-- | Source/Core/Common/Logging/LogManager.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Source/Core/Common/Logging/LogManager.cpp b/Source/Core/Common/Logging/LogManager.cpp index 01ada39c9a..7ce347cbda 100644 --- a/Source/Core/Common/Logging/LogManager.cpp +++ b/Source/Core/Common/Logging/LogManager.cpp @@ -13,6 +13,7 @@ #include "Core/Host.h" #endif #include "Common/FileUtil.h" +#include "Common/IniFile.h" #include "Common/StringUtil.h" #include "Common/Timer.h" #include "Common/Logging/ConsoleListener.h" @@ -86,15 +87,23 @@ LogManager::LogManager() m_consoleLog = new ConsoleListener(); m_debuggerLog = new DebuggerLogListener(); + IniFile ini; + ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX)); + IniFile::Section* logs = ini.GetOrCreateSection("Logs"); for (LogContainer* container : m_Log) { - container->SetEnable(true); - container->AddListener(m_fileLog); - container->AddListener(m_consoleLog); + bool enable; + logs->Get(container->GetShortName(), &enable, false); + container->SetEnable(enable); + if (enable) + { + container->AddListener(m_fileLog); + container->AddListener(m_consoleLog); #ifdef _MSC_VER - if (IsDebuggerPresent()) - container->AddListener(m_debuggerLog); + if (IsDebuggerPresent()) + container->AddListener(m_debuggerLog); #endif + } } } |
