Honor logging settings at startup
https://code.google.com/p/dolphin-emu/issues/detail?id=7959
This commit is contained in:
parent
a26cf63783
commit
6fb8ce58d6
|
@ -89,16 +89,21 @@ LogManager::LogManager()
|
|||
IniFile ini;
|
||||
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
|
||||
IniFile::Section* logs = ini.GetOrCreateSection("Logs");
|
||||
IniFile::Section* options = ini.GetOrCreateSection("Options");
|
||||
bool write_file;
|
||||
bool write_console;
|
||||
options->Get("WriteToFile", &write_file, false);
|
||||
options->Get("WriteToConsole", &write_console, true);
|
||||
|
||||
for (LogContainer* container : m_Log)
|
||||
{
|
||||
bool enable;
|
||||
logs->Get(container->GetShortName(), &enable, false);
|
||||
container->SetEnable(enable);
|
||||
if (enable)
|
||||
{
|
||||
if (enable && write_file)
|
||||
container->AddListener(m_fileLog);
|
||||
if (enable && write_console)
|
||||
container->AddListener(m_consoleLog);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue