From 6fb8ce58d64a28540a0714a843f79117d7d878c7 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 28 May 2015 09:28:23 +0200 Subject: [PATCH] Honor logging settings at startup https://code.google.com/p/dolphin-emu/issues/detail?id=7959 --- Source/Core/Common/Logging/LogManager.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/Core/Common/Logging/LogManager.cpp b/Source/Core/Common/Logging/LogManager.cpp index a7e3ae23cf..29b88f168e 100644 --- a/Source/Core/Common/Logging/LogManager.cpp +++ b/Source/Core/Common/Logging/LogManager.cpp @@ -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); - } } }