diff --git a/Source/Core/Common/Logging/LogManager.cpp b/Source/Core/Common/Logging/LogManager.cpp index b982509090..484151023d 100644 --- a/Source/Core/Common/Logging/LogManager.cpp +++ b/Source/Core/Common/Logging/LogManager.cpp @@ -100,8 +100,10 @@ LogManager::LogManager() IniFile::Section* options = ini.GetOrCreateSection("Options"); bool write_file; bool write_console; + bool write_window; options->Get("WriteToFile", &write_file, false); options->Get("WriteToConsole", &write_console, true); + options->Get("WriteToWindow", &write_window, true); // Set up log listeners int verbosity; @@ -123,6 +125,8 @@ LogManager::LogManager() container->AddListener(LogListener::FILE_LISTENER); if (enable && write_console) container->AddListener(LogListener::CONSOLE_LISTENER); + if (enable && write_window) + container->AddListener(LogListener::LOG_WINDOW_LISTENER); } m_path_cutoff_point = DeterminePathCutOffPoint(); diff --git a/Source/Core/DolphinWX/LogWindow.cpp b/Source/Core/DolphinWX/LogWindow.cpp index 3f3107692e..b7a9a34088 100644 --- a/Source/Core/DolphinWX/LogWindow.cpp +++ b/Source/Core/DolphinWX/LogWindow.cpp @@ -61,28 +61,6 @@ void CLogWindow::CreateGUIControls() log_window->Get("y", &y, Parent->GetSize().GetY()); log_window->Get("pos", &winpos, wxAUI_DOCK_RIGHT); - // Get the logger output settings from the config ini file. - options->Get("WriteToFile", &m_writeFile, false); - options->Get("WriteToWindow", &m_writeWindow, true); - - IniFile::Section* logs = ini.GetOrCreateSection("Logs"); - for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i) - { - bool enable; - logs->Get(m_LogManager->GetShortName((LogTypes::LOG_TYPE)i), &enable, false); - - if (m_writeWindow && enable) - m_LogManager->AddListener((LogTypes::LOG_TYPE)i, LogListener::LOG_WINDOW_LISTENER); - else - m_LogManager->RemoveListener((LogTypes::LOG_TYPE)i, LogListener::LOG_WINDOW_LISTENER); - - if (m_writeFile && enable) - m_LogManager->AddListener((LogTypes::LOG_TYPE)i, LogListener::FILE_LISTENER); - else - m_LogManager->RemoveListener((LogTypes::LOG_TYPE)i, LogListener::FILE_LISTENER); - } - m_has_listeners = true; - // Font m_FontChoice = new wxChoice(this, wxID_ANY); m_FontChoice->Bind(wxEVT_CHOICE, &CLogWindow::OnFontChange, this); diff --git a/Source/Core/DolphinWX/LogWindow.h b/Source/Core/DolphinWX/LogWindow.h index 26d931d52b..65b98a8b2b 100644 --- a/Source/Core/DolphinWX/LogWindow.h +++ b/Source/Core/DolphinWX/LogWindow.h @@ -45,8 +45,8 @@ private: wxTimer m_LogTimer; LogManager* m_LogManager; std::queue> msgQueue; - bool m_writeFile, m_writeWindow, m_LogAccess; - bool m_has_listeners = false; + bool m_LogAccess; + bool m_has_listeners = true; // Controls wxBoxSizer* sBottom;