diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2014-02-23 07:33:03 +0100 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2014-02-23 07:48:06 +0100 |
| commit | 70f3a069f2b760b2add51046781be625bef758db (patch) | |
| tree | 23b74ddd0815882d3a598c67ac11fc7ecf95e98a /Source/Core/Common/LogManager.cpp | |
| parent | 60a5d8900bd2bf63e4af32d60ec7f69053e13297 (diff) | |
Revert "Merge pull request #83 from lioncash/remove-console"
This breaks Linux stdout logging.
This reverts commit 7ac5b1f2f805b2bc553492606cf71b6609fa0ae7, reversing
changes made to 9bc14012fccf92f38b7d270ec82f7dac522986c5.
Revert "Merge pull request #77 from lioncash/remove-console"
This reverts commit 9bc14012fccf92f38b7d270ec82f7dac522986c5, reversing
changes made to b18a33377d7229a66226a524186d24c57f1d56aa.
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
Diffstat (limited to 'Source/Core/Common/LogManager.cpp')
| -rw-r--r-- | Source/Core/Common/LogManager.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/Core/Common/LogManager.cpp b/Source/Core/Common/LogManager.cpp index 860ad49ec4..f87bd0c3d9 100644 --- a/Source/Core/Common/LogManager.cpp +++ b/Source/Core/Common/LogManager.cpp @@ -12,6 +12,7 @@ #ifdef ANDROID #include "Core/Host.h" #endif +#include "Common/ConsoleListener.h" #include "Common/FileUtil.h" #include "Common/Log.h" #include "Common/LogManager.h" @@ -82,11 +83,18 @@ LogManager::LogManager() m_Log[LogTypes::NETPLAY] = new LogContainer("NETPLAY", "Netplay"); m_fileLog = new FileLogListener(File::GetUserPath(F_MAINLOG_IDX).c_str()); + m_consoleLog = new ConsoleListener(); + m_debuggerLog = new DebuggerLogListener(); for (LogContainer* container : m_Log) { container->SetEnable(true); container->AddListener(m_fileLog); + container->AddListener(m_consoleLog); +#ifdef _MSC_VER + if (IsDebuggerPresent()) + container->AddListener(m_debuggerLog); +#endif } } @@ -95,12 +103,16 @@ LogManager::~LogManager() for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i) { 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) delete container; delete m_fileLog; + delete m_consoleLog; + delete m_debuggerLog; } void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, @@ -181,3 +193,10 @@ 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 +} |
