Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dschmidt/libcrashreporter-qt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2020-10-19 13:21:52 +0300
committerHannah von Reth <hannah.vonreth@owncloud.com>2020-10-19 13:21:52 +0300
commit318f125ecbeab106586c8a554602c46a5f1e7177 (patch)
tree21346b342101d0201a12f24b35ebbfc71d4c90c7
parent795445369296f8cb86cae2bc7896b0314b871b81 (diff)
Don't print debug message to std::wcout
-rw-r--r--src/libcrashreporter-handler/Handler.cpp17
1 files changed, 16 insertions, 1 deletions
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});
}