mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
Read the config file before enabling logs.
This commit is contained in:
parent
6e2b873ec1
commit
22d2c7d053
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ void CLogWindow::CreateGUIControls()
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
{
|
||||
bool enable;
|
||||
logs->Get(m_LogManager->GetShortName((LogTypes::LOG_TYPE)i), &enable, true);
|
||||
logs->Get(m_LogManager->GetShortName((LogTypes::LOG_TYPE)i), &enable, false);
|
||||
|
||||
if (m_writeWindow && enable)
|
||||
m_LogManager->AddListener((LogTypes::LOG_TYPE)i, this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user