diff options
author | Dominik Schmidt <dev@dominik-schmidt.de> | 2020-10-19 16:14:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 16:14:32 +0300 |
commit | d9c3296e5b594c292307a01fb5d57a7dc16bdcd9 (patch) | |
tree | 21346b342101d0201a12f24b35ebbfc71d4c90c7 | |
parent | a4409c5c1b39dc208518bd0f2868fc2894bdcb3f (diff) | |
parent | 318f125ecbeab106586c8a554602c46a5f1e7177 (diff) |
Merge pull request #23 from TheOneRing/work/don_t_spam
Don't write debug msg to std::wcout
-rw-r--r-- | src/libcrashreporter-gui/CMakeLists.txt | 38 | ||||
-rw-r--r-- | src/libcrashreporter-handler/Handler.cpp | 17 |
2 files changed, 35 insertions, 20 deletions
diff --git a/src/libcrashreporter-gui/CMakeLists.txt b/src/libcrashreporter-gui/CMakeLists.txt index 9f2a1f6..4420e33 100644 --- a/src/libcrashreporter-gui/CMakeLists.txt +++ b/src/libcrashreporter-gui/CMakeLists.txt @@ -1,28 +1,28 @@ -if(NOT ENABLE_GPL_CODE) - message(FATAL_ERROR "Using the Linux build requires ENABLE_GPL_CODE to be true.") -endif() - set(crashreporter_SOURCES CrashReporter.cpp CrashReporterGzip.cpp) set(crashreporter_UI CrashReporter.ui) set(crashreporter_RC ../../resources.qrc) set(crashreporter_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR} ${QT_INCLUDES}) if(UNIX AND NOT APPLE) -list(APPEND crashreporter_INCLUDE_DIRECTORIES - ${CMAKE_CURRENT_LIST_DIR}/../../3rdparty/drkonqi-parser -) -list(APPEND crashreporter_LIBRARIES - drkonqi_backtrace_parser -) -list(APPEND crashreporter_SOURCES - linux-backtrace-generator/crashedapplication.cpp - linux-backtrace-generator/backtracegenerator.cpp - linux-backtrace-generator/debugger.cpp - linux-backtrace-generator/crqt-kmacroexpander.cpp - linux-backtrace-generator/crqt-kmacroexpander_unix.cpp - linux-backtrace-generator/crqt-kshell.cpp - linux-backtrace-generator/crqt-kshell_unix.cpp -) + if(NOT ENABLE_GPL_CODE) + message(FATAL_ERROR "Using the Linux build requires ENABLE_GPL_CODE to be true.") + endif() + + list(APPEND crashreporter_INCLUDE_DIRECTORIES + ${CMAKE_CURRENT_LIST_DIR}/../../3rdparty/drkonqi-parser + ) + list(APPEND crashreporter_LIBRARIES + drkonqi_backtrace_parser + ) + list(APPEND crashreporter_SOURCES + linux-backtrace-generator/crashedapplication.cpp + linux-backtrace-generator/backtracegenerator.cpp + linux-backtrace-generator/debugger.cpp + linux-backtrace-generator/crqt-kmacroexpander.cpp + linux-backtrace-generator/crqt-kmacroexpander_unix.cpp + linux-backtrace-generator/crqt-kshell.cpp + linux-backtrace-generator/crqt-kshell_unix.cpp + ) endif() add_library(crashreporter-gui STATIC diff --git a/src/libcrashreporter-handler/Handler.cpp b/src/libcrashreporter-handler/Handler.cpp index 40307ac..83f6dc2 100644 --- a/src/libcrashreporter-handler/Handler.cpp +++ b/src/libcrashreporter-handler/Handler.cpp @@ -23,6 +23,7 @@ #include <string> #include <iostream> +#include <sstream> #include <QCoreApplication> #include <QFileInfo> @@ -40,6 +41,20 @@ # include <cstdio> #endif +namespace { +void logWindows(const std::vector<const wchar_t*> &msg) { +#ifdef Q_OS_WIN + std::wstringstream out; + for (const auto s : msg) { + out << s; + } + OutputDebugStringW(out.str().data()); +#else + Q_UNUSED(msg); +#endif +} +} + namespace CrashReporter { @@ -291,7 +306,7 @@ Handler::setCrashReporter( const QString& crashReporter ) wreporter = new wchar_t[ wsreporter.size() + 10 ]; wcscpy( wreporter, wsreporter.c_str() ); m_crashReporterWChar = wreporter; - std::wcout << "m_crashReporterWChar: " << m_crashReporterWChar; + logWindows({L"m_crashReporterWChar: ", m_crashReporterWChar}); } |