[windows] Remove ConsoleListener, which was not actually used.

Replace it with the DebuggerLogListener.
This commit is contained in:
Shawn Hoffman 2015-03-15 22:11:18 -07:00
parent 7cda374910
commit 0a79b6d5a7
13 changed files with 78 additions and 466 deletions

View File

@ -31,7 +31,7 @@ set(SRCS BreakPoints.cpp
x64Emitter.cpp
Crypto/bn.cpp
Crypto/ec.cpp
Logging/ConsoleListener.cpp
Logging/ConsoleListenerNix.cpp
Logging/LogManager.cpp)
set(LIBS enet)

View File

@ -102,6 +102,7 @@
<ClCompile Include="Hash.cpp" />
<ClCompile Include="IniFile.cpp" />
<ClCompile Include="JitRegister.cpp" />
<ClCompile Include="Logging\ConsoleListenerWin.cpp" />
<ClCompile Include="MathUtil.cpp" />
<ClCompile Include="MemArena.cpp" />
<ClCompile Include="MemoryUtil.cpp" />
@ -128,7 +129,6 @@
<ClCompile Include="XSaveWorkaround.cpp" />
<ClCompile Include="Crypto\bn.cpp" />
<ClCompile Include="Crypto\ec.cpp" />
<ClCompile Include="Logging\ConsoleListener.cpp" />
<ClCompile Include="Logging\LogManager.cpp" />
</ItemGroup>
<ItemGroup>
@ -148,4 +148,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -112,9 +112,6 @@
<ClCompile Include="Crypto\ec.cpp">
<Filter>Crypto</Filter>
</ClCompile>
<ClCompile Include="Logging\ConsoleListener.cpp">
<Filter>Logging</Filter>
</ClCompile>
<ClCompile Include="Logging\LogManager.cpp">
<Filter>Logging</Filter>
</ClCompile>
@ -122,6 +119,9 @@
<ClCompile Include="GekkoDisassembler.cpp" />
<ClCompile Include="JitRegister.cpp" />
<ClCompile Include="TraversalClient.cpp" />
<ClCompile Include="Logging\ConsoleListenerWin.cpp">
<Filter>Logging</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Text Include="CMakeLists.txt" />

View File

@ -1,340 +0,0 @@
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#include <algorithm> // min
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string> // System: To be able to add strings with "+"
#ifdef _WIN32
#include <windows.h>
#include <array>
#endif
#include "Common/StringUtil.h"
#include "Common/Logging/ConsoleListener.h"
ConsoleListener::ConsoleListener()
{
#ifdef _WIN32
hConsole = nullptr;
bUseColor = true;
#else
bUseColor = isatty(fileno(stdout));
#endif
}
ConsoleListener::~ConsoleListener()
{
Close();
}
// 100, 100, "Dolphin Log Console"
// Open console window - width and height is the size of console window
// Name is the window title
void ConsoleListener::Open(bool Hidden, int Width, int Height, const char *Title)
{
#ifdef _WIN32
if (!GetConsoleWindow())
{
// Open the console window and create the window handle for GetStdHandle()
AllocConsole();
// Hide
if (Hidden)
ShowWindow(GetConsoleWindow(), SW_HIDE);
// Save the window handle that AllocConsole() created
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
// Set the console window title
SetConsoleTitle(UTF8ToTStr(Title).c_str());
// Set letter space
LetterSpace(80, 4000);
//MoveWindow(GetConsoleWindow(), 200,200, 800,800, true);
}
else
{
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
}
#endif
}
void ConsoleListener::UpdateHandle()
{
#ifdef _WIN32
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
#endif
}
// Close the console window and close the eventual file handle
void ConsoleListener::Close()
{
#ifdef _WIN32
if (hConsole == nullptr)
return;
FreeConsole();
hConsole = nullptr;
#else
fflush(nullptr);
#endif
}
bool ConsoleListener::IsOpen()
{
#ifdef _WIN32
return (hConsole != nullptr);
#else
return true;
#endif
}
/*
LetterSpace: SetConsoleScreenBufferSize and SetConsoleWindowInfo are
dependent on each other, that's the reason for the additional checks.
*/
void ConsoleListener::BufferWidthHeight(int BufferWidth, int BufferHeight, int ScreenWidth, int ScreenHeight, bool BufferFirst)
{
#ifdef _WIN32
BOOL SB, SW;
if (BufferFirst)
{
// Change screen buffer size
COORD Co = {BufferWidth, BufferHeight};
SB = SetConsoleScreenBufferSize(hConsole, Co);
// Change the screen buffer window size
SMALL_RECT coo = {0,0,ScreenWidth, ScreenHeight}; // top, left, right, bottom
SW = SetConsoleWindowInfo(hConsole, TRUE, &coo);
}
else
{
// Change the screen buffer window size
SMALL_RECT coo = {0,0, ScreenWidth, ScreenHeight}; // top, left, right, bottom
SW = SetConsoleWindowInfo(hConsole, TRUE, &coo);
// Change screen buffer size
COORD Co = {BufferWidth, BufferHeight};
SB = SetConsoleScreenBufferSize(hConsole, Co);
}
#endif
}
void ConsoleListener::LetterSpace(int Width, int Height)
{
#ifdef _WIN32
// Get console info
CONSOLE_SCREEN_BUFFER_INFO ConInfo;
GetConsoleScreenBufferInfo(hConsole, &ConInfo);
//
int OldBufferWidth = ConInfo.dwSize.X;
int OldBufferHeight = ConInfo.dwSize.Y;
int OldScreenWidth = (ConInfo.srWindow.Right - ConInfo.srWindow.Left);
int OldScreenHeight = (ConInfo.srWindow.Bottom - ConInfo.srWindow.Top);
//
int NewBufferWidth = Width;
int NewBufferHeight = Height;
int NewScreenWidth = NewBufferWidth - 1;
int NewScreenHeight = OldScreenHeight;
// Width
BufferWidthHeight(NewBufferWidth, OldBufferHeight, NewScreenWidth, OldScreenHeight, (NewBufferWidth > OldScreenWidth - 1));
// Height
BufferWidthHeight(NewBufferWidth, NewBufferHeight, NewScreenWidth, NewScreenHeight, (NewBufferHeight > OldScreenHeight - 1));
// Resize the window too
//MoveWindow(GetConsoleWindow(), 200,200, (Width*8 + 50),(NewScreenHeight*12 + 200), true);
#endif
}
#ifdef _WIN32
COORD ConsoleListener::GetCoordinates(int BytesRead, int BufferWidth)
{
COORD Ret = {0, 0};
// Full rows
int Step = (int)floor((float)BytesRead / (float)BufferWidth);
Ret.Y += Step;
// Partial row
Ret.X = BytesRead - (BufferWidth * Step);
return Ret;
}
#endif
void ConsoleListener::PixelSpace(int Left, int Top, int Width, int Height, bool Resize)
{
#ifdef _WIN32
// Check size
if (Width < 8 || Height < 12)
return;
bool DBef = true;
bool DAft = true;
std::string SLog = "";
const HWND hWnd = GetConsoleWindow();
const HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
// Get console info
CONSOLE_SCREEN_BUFFER_INFO ConInfo;
GetConsoleScreenBufferInfo(hConsole, &ConInfo);
DWORD BufferSize = ConInfo.dwSize.X * ConInfo.dwSize.Y;
// ---------------------------------------------------------------------
// Save the current text
// ------------------------
DWORD cCharsRead = 0;
COORD coordScreen = { 0, 0 };
static const int MAX_BYTES = 1024 * 16;
std::vector<std::array<TCHAR, MAX_BYTES>> Str;
std::vector<std::array<WORD, MAX_BYTES>> Attr;
// ReadConsoleOutputAttribute seems to have a limit at this level
static const int ReadBufferSize = MAX_BYTES - 32;
DWORD cAttrRead = ReadBufferSize;
DWORD BytesRead = 0;
while (BytesRead < BufferSize)
{
Str.resize(Str.size() + 1);
if (!ReadConsoleOutputCharacter(hConsole, Str.back().data(), ReadBufferSize, coordScreen, &cCharsRead))
SLog += StringFromFormat("WriteConsoleOutputCharacter error");
Attr.resize(Attr.size() + 1);
if (!ReadConsoleOutputAttribute(hConsole, Attr.back().data(), ReadBufferSize, coordScreen, &cAttrRead))
SLog += StringFromFormat("WriteConsoleOutputAttribute error");
// Break on error
if (cAttrRead == 0) break;
BytesRead += cAttrRead;
coordScreen = GetCoordinates(BytesRead, ConInfo.dwSize.X);
}
// Letter space
int LWidth = (int)(floor((float)Width / 8.0f) - 1.0f);
int LHeight = (int)(floor((float)Height / 12.0f) - 1.0f);
int LBufWidth = LWidth + 1;
int LBufHeight = (int)floor((float)BufferSize / (float)LBufWidth);
// Change screen buffer size
LetterSpace(LBufWidth, LBufHeight);
ClearScreen(true);
coordScreen.Y = 0;
coordScreen.X = 0;
DWORD cCharsWritten = 0;
int BytesWritten = 0;
DWORD cAttrWritten = 0;
for (size_t i = 0; i < Attr.size(); i++)
{
if (!WriteConsoleOutputCharacter(hConsole, Str[i].data(), ReadBufferSize, coordScreen, &cCharsWritten))
SLog += StringFromFormat("WriteConsoleOutputCharacter error");
if (!WriteConsoleOutputAttribute(hConsole, Attr[i].data(), ReadBufferSize, coordScreen, &cAttrWritten))
SLog += StringFromFormat("WriteConsoleOutputAttribute error");
BytesWritten += cAttrWritten;
coordScreen = GetCoordinates(BytesWritten, LBufWidth);
}
const int OldCursor = ConInfo.dwCursorPosition.Y * ConInfo.dwSize.X + ConInfo.dwCursorPosition.X;
COORD Coo = GetCoordinates(OldCursor, LBufWidth);
SetConsoleCursorPosition(hConsole, Coo);
if (SLog.length() > 0)
Log(LogTypes::LNOTICE, SLog.c_str());
// Resize the window too
if (Resize)
MoveWindow(GetConsoleWindow(), Left, Top, (Width + 100), Height, true);
#endif
}
void ConsoleListener::Log(LogTypes::LOG_LEVELS Level, const char *Text)
{
#if defined(_WIN32)
/*
const int MAX_BYTES = 1024*10;
char Str[MAX_BYTES];
va_list ArgPtr;
int Cnt;
va_start(ArgPtr, Text);
Cnt = vsnprintf(Str, MAX_BYTES, Text, ArgPtr);
va_end(ArgPtr);
*/
DWORD cCharsWritten;
WORD Color;
switch (Level)
{
case LogTypes::LOG_LEVELS::LNOTICE: // light green
Color = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
break;
case LogTypes::LOG_LEVELS::LERROR: // light red
Color = FOREGROUND_RED | FOREGROUND_INTENSITY;
break;
case LogTypes::LOG_LEVELS::LWARNING: // light yellow
Color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
break;
case LogTypes::LOG_LEVELS::LINFO: // cyan
Color = FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY;
break;
case LogTypes::LOG_LEVELS::LDEBUG: // gray
Color = FOREGROUND_INTENSITY;
break;
default: // off-white
Color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
break;
}
if (strlen(Text) > 10)
{
// First 10 chars white
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
WriteConsole(hConsole, Text, 10, &cCharsWritten, nullptr);
Text += 10;
}
SetConsoleTextAttribute(hConsole, Color);
WriteConsole(hConsole, Text, (DWORD)strlen(Text), &cCharsWritten, nullptr);
#else
char ColorAttr[16] = "";
char ResetAttr[16] = "";
if (bUseColor)
{
strcpy(ResetAttr, "\033[0m");
switch (Level)
{
case LogTypes::LOG_LEVELS::LNOTICE: // light green
strcpy(ColorAttr, "\033[92m");
break;
case LogTypes::LOG_LEVELS::LERROR: // light red
strcpy(ColorAttr, "\033[91m");
break;
case LogTypes::LOG_LEVELS::LWARNING: // light yellow
strcpy(ColorAttr, "\033[93m");
break;
default:
break;
}
}
fprintf(stderr, "%s%s%s", ColorAttr, Text, ResetAttr);
#endif
}
// Clear console screen
void ConsoleListener::ClearScreen(bool Cursor)
{
#if defined(_WIN32)
COORD coordScreen = { 0, 0 };
DWORD cCharsWritten;
CONSOLE_SCREEN_BUFFER_INFO csbi;
DWORD dwConSize;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hConsole, &csbi);
dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
// Write space to the entire console
FillConsoleOutputCharacter(hConsole, TEXT(' '), dwConSize, coordScreen, &cCharsWritten);
GetConsoleScreenBufferInfo(hConsole, &csbi);
FillConsoleOutputAttribute(hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten);
// Reset cursor
if (Cursor)
SetConsoleCursorPosition(hConsole, coordScreen);
#endif
}

View File

@ -6,33 +6,14 @@
#include "Common/Logging/LogManager.h"
#ifdef _WIN32
#include <windows.h>
#endif
class ConsoleListener : public LogListener
{
public:
ConsoleListener();
~ConsoleListener();
void Open(bool Hidden = false, int Width = 100, int Height = 100, const char * Name = "Console");
void UpdateHandle();
void Close();
bool IsOpen();
void LetterSpace(int Width, int Height);
void BufferWidthHeight(int BufferWidth, int BufferHeight, int ScreenWidth, int ScreenHeight, bool BufferFirst);
void PixelSpace(int Left, int Top, int Width, int Height, bool);
#ifdef _WIN32
COORD GetCoordinates(int BytesRead, int BufferWidth);
#endif
void Log(LogTypes::LOG_LEVELS, const char *Text) override;
void ClearScreen(bool Cursor = true);
void Log(LogTypes::LOG_LEVELS, const char *text) override;
private:
#ifdef _WIN32
HWND GetHwnd();
HANDLE hConsole;
#endif
bool bUseColor;
bool m_use_color;
};

View File

@ -0,0 +1,46 @@
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#include <cstdio>
#include "Common/Logging/ConsoleListener.h"
ConsoleListener::ConsoleListener()
{
m_use_color = !!isatty(fileno(stdout));
}
ConsoleListener::~ConsoleListener()
{
fflush(nullptr);
}
void ConsoleListener::Log(LogTypes::LOG_LEVELS level, const char *text)
{
char color_attr[16] = "";
char reset_attr[16] = "";
if (m_use_color)
{
strcpy(reset_attr, "\x1b[0m");
switch (level)
{
case LogTypes::LOG_LEVELS::LNOTICE:
// light green
strcpy(color_attr, "\x1b[92m");
break;
case LogTypes::LOG_LEVELS::LERROR:
// light red
strcpy(color_attr, "\x1b[91m");
break;
case LogTypes::LOG_LEVELS::LWARNING:
// light yellow
strcpy(color_attr, "\x1b[93m");
break;
default:
break;
}
}
fprintf(stderr, "%s%s%s", color_attr, text, reset_attr);
}

View File

@ -0,0 +1,20 @@
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#include <debugapi.h>
#include "Common/Logging/ConsoleListener.h"
ConsoleListener::ConsoleListener()
{
}
ConsoleListener::~ConsoleListener()
{
}
void ConsoleListener::Log(LogTypes::LOG_LEVELS level, const char *text)
{
::OutputDebugStringA(text);
}

View File

@ -85,7 +85,6 @@ LogManager::LogManager()
m_fileLog = new FileLogListener(File::GetUserPath(F_MAINLOG_IDX));
m_consoleLog = new ConsoleListener();
m_debuggerLog = new DebuggerLogListener();
IniFile ini;
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
@ -99,10 +98,6 @@ LogManager::LogManager()
{
container->AddListener(m_fileLog);
container->AddListener(m_consoleLog);
#ifdef _MSC_VER
if (IsDebuggerPresent())
container->AddListener(m_debuggerLog);
#endif
}
}
}
@ -113,7 +108,6 @@ LogManager::~LogManager()
{
m_logManager->RemoveListener((LogTypes::LOG_TYPE)i, m_fileLog);
m_logManager->RemoveListener((LogTypes::LOG_TYPE)i, m_consoleLog);
m_logManager->RemoveListener((LogTypes::LOG_TYPE)i, m_debuggerLog);
}
for (LogContainer* container : m_Log)
@ -121,7 +115,6 @@ LogManager::~LogManager()
delete m_fileLog;
delete m_consoleLog;
delete m_debuggerLog;
}
void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
@ -202,10 +195,3 @@ void FileLogListener::Log(LogTypes::LOG_LEVELS, const char *msg)
std::lock_guard<std::mutex> lk(m_log_lock);
m_logfile << msg << std::flush;
}
void DebuggerLogListener::Log(LogTypes::LOG_LEVELS, const char *msg)
{
#if _MSC_VER
::OutputDebugStringA(msg);
#endif
}

View File

@ -44,12 +44,6 @@ private:
bool m_enable;
};
class DebuggerLogListener : public LogListener
{
public:
void Log(LogTypes::LOG_LEVELS, const char *msg) override;
};
class LogContainer
{
public:
@ -89,7 +83,6 @@ private:
LogContainer* m_Log[LogTypes::NUMBER_OF_LOGS];
FileLogListener *m_fileLog;
ConsoleListener *m_consoleLog;
DebuggerLogListener *m_debuggerLog;
static LogManager *m_logManager; // Singleton. Ugh.
LogManager();
@ -146,11 +139,6 @@ public:
return m_consoleLog;
}
DebuggerLogListener *GetDebuggerListener() const
{
return m_debuggerLog;
}
static LogManager* GetInstance()
{
return m_logManager;

View File

@ -64,14 +64,6 @@ void LogConfigWindow::CreateGUIControls()
m_writeConsoleCB->Bind(wxEVT_CHECKBOX, &LogConfigWindow::OnWriteConsoleChecked, this);
m_writeWindowCB = new wxCheckBox(this, wxID_ANY, _("Write to Window"));
m_writeWindowCB->Bind(wxEVT_CHECKBOX, &LogConfigWindow::OnWriteWindowChecked, this);
m_writeDebuggerCB = nullptr;
#ifdef _MSC_VER
if (IsDebuggerPresent())
{
m_writeDebuggerCB = new wxCheckBox(this, wxID_ANY, _("Write to Debugger"));
m_writeDebuggerCB->Bind(wxEVT_CHECKBOX, &LogConfigWindow::OnWriteDebuggerChecked, this);
}
#endif
wxButton *btn_toggle_all = new wxButton(this, wxID_ANY, _("Toggle All Log Types"),
wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
@ -85,17 +77,7 @@ void LogConfigWindow::CreateGUIControls()
wxStaticBoxSizer* sbOutputs = new wxStaticBoxSizer(wxVERTICAL, this, _("Logger Outputs"));
sbOutputs->Add(m_writeFileCB, 0, wxDOWN, 1);
sbOutputs->Add(m_writeConsoleCB, 0, wxDOWN, 1);
#ifdef _MSC_VER
if (m_writeDebuggerCB)
{
sbOutputs->Add(m_writeWindowCB, 0, wxDOWN, 1);
sbOutputs->Add(m_writeDebuggerCB, 0);
}
else
#endif
{
sbOutputs->Add(m_writeWindowCB, 0);
}
sbOutputs->Add(m_writeWindowCB, 0);
wxStaticBoxSizer* sbLogTypes = new wxStaticBoxSizer(wxVERTICAL, this, _("Log Types"));
sbLogTypes->Add(m_checks, 1, wxEXPAND);
@ -137,17 +119,6 @@ void LogConfigWindow::LoadSettings()
m_writeConsoleCB->SetValue(m_writeConsole);
options->Get("WriteToWindow", &m_writeWindow, true);
m_writeWindowCB->SetValue(m_writeWindow);
#ifdef _MSC_VER
if (IsDebuggerPresent())
{
options->Get("WriteToDebugger", &m_writeDebugger, true);
m_writeDebuggerCB->SetValue(m_writeDebugger);
}
else
#endif
{
m_writeDebugger = false;
}
// Run through all of the log types and check each checkbox for each logging type
// depending on its set value within the config ini.
@ -173,10 +144,6 @@ void LogConfigWindow::SaveSettings()
options->Set("WriteToFile", m_writeFile);
options->Set("WriteToConsole", m_writeConsole);
options->Set("WriteToWindow", m_writeWindow);
#ifdef _MSC_VER
if (IsDebuggerPresent())
options->Set("WriteToDebugger", m_writeDebugger);
#endif
// Save all enabled/disabled states of the log types to the config ini.
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
@ -247,21 +214,6 @@ void LogConfigWindow::OnWriteWindowChecked(wxCommandEvent& event)
}
}
void LogConfigWindow::OnWriteDebuggerChecked(wxCommandEvent& event)
{
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
{
m_writeDebugger = event.IsChecked();
if (m_checks->IsChecked(i))
{
if (m_writeDebugger)
m_LogManager->AddListener((LogTypes::LOG_TYPE)i, (LogListener *)m_LogManager->GetDebuggerListener());
else
m_LogManager->RemoveListener((LogTypes::LOG_TYPE)i, (LogListener *)m_LogManager->GetDebuggerListener());
}
}
}
void LogConfigWindow::OnToggleAll(wxCommandEvent& WXUNUSED(event))
{
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
@ -286,15 +238,12 @@ void LogConfigWindow::ToggleLog(int _logType, bool enable)
m_LogManager->AddListener(logType, m_LogManager->GetFileListener());
if (m_writeConsole)
m_LogManager->AddListener(logType, m_LogManager->GetConsoleListener());
if (m_writeDebugger)
m_LogManager->AddListener(logType, m_LogManager->GetDebuggerListener());
}
else
{
m_LogManager->RemoveListener(logType, (LogListener *)m_LogWindow);
m_LogManager->RemoveListener(logType, m_LogManager->GetFileListener());
m_LogManager->RemoveListener(logType, m_LogManager->GetConsoleListener());
m_LogManager->RemoveListener(logType, m_LogManager->GetDebuggerListener());
}
}

View File

@ -28,11 +28,11 @@ public:
private:
LogManager *m_LogManager;
CLogWindow *m_LogWindow;
bool m_writeFile, m_writeConsole, m_writeWindow, m_writeDebugger;
bool m_writeFile, m_writeConsole, m_writeWindow;
bool enableAll;
// Controls
wxCheckBox *m_writeFileCB, *m_writeConsoleCB, *m_writeWindowCB, *m_writeDebuggerCB;
wxCheckBox *m_writeFileCB, *m_writeConsoleCB, *m_writeWindowCB;
wxCheckListBox* m_checks;
wxRadioBox *m_verbosity;
@ -41,7 +41,6 @@ private:
void OnWriteFileChecked(wxCommandEvent& event);
void OnWriteConsoleChecked(wxCommandEvent& event);
void OnWriteWindowChecked(wxCommandEvent& event);
void OnWriteDebuggerChecked(wxCommandEvent& event);
void OnToggleAll(wxCommandEvent& event);
void ToggleLog(int _logType, bool enable);
void OnLogCheck(wxCommandEvent& event);

View File

@ -83,16 +83,6 @@ void CLogWindow::CreateGUIControls()
// Get the logger output settings from the config ini file.
options->Get("WriteToFile", &m_writeFile, false);
options->Get("WriteToWindow", &m_writeWindow, true);
#ifdef _MSC_VER
if (IsDebuggerPresent())
{
options->Get("WriteToDebugger", &m_writeDebugger, true);
}
else
#endif
{
m_writeDebugger = false;
}
IniFile::Section* logs = ini.GetOrCreateSection("Logs");
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
@ -110,11 +100,6 @@ void CLogWindow::CreateGUIControls()
else
m_LogManager->RemoveListener((LogTypes::LOG_TYPE)i, m_LogManager->GetFileListener());
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));
}
@ -214,8 +199,6 @@ void CLogWindow::OnClear(wxCommandEvent& WXUNUSED (event))
while (!msgQueue.empty())
msgQueue.pop();
}
m_LogManager->GetConsoleListener()->ClearScreen();
}
void CLogWindow::UnPopulateBottom()

View File

@ -52,7 +52,7 @@ private:
wxTimer m_LogTimer;
LogManager* m_LogManager;
std::queue<std::pair<u8, wxString> > msgQueue;
bool m_writeFile, m_writeWindow, m_writeDebugger, m_LogAccess;
bool m_writeFile, m_writeWindow, m_LogAccess;
// Controls
wxBoxSizer* sBottom;