mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
Revert "Merge pull request #83 from lioncash/remove-console"
This breaks Linux stdout logging. This reverts commit7ac5b1f2f8
, reversing changes made to9bc14012fc
. Revert "Merge pull request #77 from lioncash/remove-console" This reverts commit9bc14012fc
, reversing changes made tob18a33377d
. Conflicts: Source/Core/Common/LogManager.cpp Source/Core/DolphinWX/Frame.cpp Source/Core/DolphinWX/FrameAui.cpp Source/Core/DolphinWX/LogConfigWindow.cpp Source/Core/DolphinWX/LogWindow.cpp
This commit is contained in:
@ -29,9 +29,11 @@
|
||||
#include <wx/aui/framemanager.h>
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/ConsoleListener.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/IniFile.h"
|
||||
#include "Common/LogManager.h"
|
||||
#include "Core/Console.h"
|
||||
#include "DolphinWX/Frame.h"
|
||||
#include "DolphinWX/LogWindow.h"
|
||||
#include "DolphinWX/WxUtils.h"
|
||||
@ -42,6 +44,7 @@
|
||||
|
||||
BEGIN_EVENT_TABLE(CLogWindow, wxPanel)
|
||||
EVT_CLOSE(CLogWindow::OnClose)
|
||||
EVT_TEXT_ENTER(IDM_SUBMITCMD, CLogWindow::OnSubmit)
|
||||
EVT_BUTTON(IDM_CLEARLOG, CLogWindow::OnClear)
|
||||
EVT_CHOICE(IDM_FONT, CLogWindow::OnFontChange)
|
||||
EVT_CHECKBOX(IDM_WRAPLINE, CLogWindow::OnWrapLineCheck)
|
||||
@ -84,7 +87,18 @@ void CLogWindow::CreateGUIControls()
|
||||
|
||||
// Get the logger output settings from the config ini file.
|
||||
ini.Get("Options", "WriteToFile", &m_writeFile, false);
|
||||
ini.Get("Options", "WriteToConsole", &m_writeConsole, true);
|
||||
ini.Get("Options", "WriteToWindow", &m_writeWindow, true);
|
||||
#ifdef _MSC_VER
|
||||
if (IsDebuggerPresent())
|
||||
{
|
||||
ini.Get("Options", "WriteToDebugger", &m_writeDebugger, true);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
m_writeDebugger = false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
{
|
||||
@ -101,6 +115,16 @@ void CLogWindow::CreateGUIControls()
|
||||
else
|
||||
m_LogManager->RemoveListener((LogTypes::LOG_TYPE)i, m_LogManager->GetFileListener());
|
||||
|
||||
if (m_writeConsole && enable)
|
||||
m_LogManager->AddListener((LogTypes::LOG_TYPE)i, m_LogManager->GetConsoleListener());
|
||||
else
|
||||
m_LogManager->RemoveListener((LogTypes::LOG_TYPE)i, m_LogManager->GetConsoleListener());
|
||||
|
||||
if (m_writeDebugger && enable)
|
||||
m_LogManager->AddListener((LogTypes::LOG_TYPE)i, m_LogManager->GetDebuggerListener());
|
||||
else
|
||||
m_LogManager->RemoveListener((LogTypes::LOG_TYPE)i, m_LogManager->GetDebuggerListener());
|
||||
|
||||
m_LogManager->SetLogLevel((LogTypes::LOG_TYPE)i, (LogTypes::LOG_LEVELS)(verbosity));
|
||||
}
|
||||
|
||||
@ -185,15 +209,25 @@ void CLogWindow::SaveSettings()
|
||||
ini.Save(File::GetUserPath(F_LOGGERCONFIG_IDX));
|
||||
}
|
||||
|
||||
void CLogWindow::OnSubmit(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
if (!m_cmdline) return;
|
||||
Console_Submit(WxStrToStr(m_cmdline->GetValue()).c_str());
|
||||
m_cmdline->SetValue(wxEmptyString);
|
||||
}
|
||||
|
||||
void CLogWindow::OnClear(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
m_Log->Clear();
|
||||
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(m_LogSection);
|
||||
int msgQueueSize = (int)msgQueue.size();
|
||||
for (int i = 0; i < msgQueueSize; i++)
|
||||
msgQueue.pop();
|
||||
}
|
||||
|
||||
m_LogManager->GetConsoleListener()->ClearScreen();
|
||||
}
|
||||
|
||||
void CLogWindow::UnPopulateBottom()
|
||||
|
Reference in New Issue
Block a user