diff options
| author | shuffle2 <godisgovernment@gmail.com> | 2014-09-03 17:20:11 -0700 |
|---|---|---|
| committer | shuffle2 <godisgovernment@gmail.com> | 2014-09-03 17:20:11 -0700 |
| commit | 4fcb633df5e7b3bdc4ddb2347d7ad7cf0eb165f6 (patch) | |
| tree | 270331bebc614181a60746231e83210c1600d626 /Source/Core/Common/Logging/LogManager.cpp | |
| parent | 1f6f01e2a0dc8c5d96f2ebf15ee2d6b03a79eeec (diff) | |
| parent | 22d2c7d0533bf7b82163e452f536647b0bb32c66 (diff) | |
Merge pull request #961 from RachelBryk/logs
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 + } } } |
