summaryrefslogtreecommitdiffstats
path: root/common/log.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-05-18 13:43:34 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-05-18 13:43:34 +0200
commit65264424f949dd529ef7613d2198623eddd951ad (patch)
treeaffe89d58a050a2b2f76d8bdbe1d5d7f1492d1ab /common/log.cpp
parent78d9ca435ff06675da79426e09fe9be32106ce35 (diff)
downloadsink-65264424f949dd529ef7613d2198623eddd951ad.tar.gz
sink-65264424f949dd529ef7613d2198623eddd951ad.zip
Log to OutputDebugString on windows
Diffstat (limited to 'common/log.cpp')
-rw-r--r--common/log.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/log.cpp b/common/log.cpp
index 40d9509..007b749 100644
--- a/common/log.cpp
+++ b/common/log.cpp
@@ -10,6 +10,7 @@
10#include <QMutexLocker> 10#include <QMutexLocker>
11#include <iostream> 11#include <iostream>
12#ifdef Q_OS_WIN 12#ifdef Q_OS_WIN
13#include <windows.h>
13#include <io.h> 14#include <io.h>
14#include <process.h> 15#include <process.h>
15#else 16#else
@@ -64,7 +65,12 @@ public:
64 } 65 }
65 qint64 writeData(const char *data, qint64 len) 66 qint64 writeData(const char *data, qint64 len)
66 { 67 {
68#ifdef Q_OS_WIN
69 const auto string = QString::fromUtf8(data, leng)
70 OutputDebugString(reinterpret_cast<const wchar_t*>(string.utf16()));
71#else
67 std::cout << data << std::endl; 72 std::cout << data << std::endl;
73#endif
68 return len; 74 return len;
69 } 75 }
70 76