mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
QsLog: Fix Windows console output
This commit is contained in:
parent
0ead759364
commit
6899bfbcf1
11
third_party/QsLog/QsLogDestConsole.cpp
vendored
11
third_party/QsLog/QsLogDestConsole.cpp
vendored
@ -31,17 +31,18 @@
|
||||
#include <cstdio>
|
||||
void QsDebugOutput::output( const QString& message )
|
||||
{
|
||||
fprintf(stderr, "%s\n", qPrintable(message));
|
||||
fflush(stderr);
|
||||
fprintf(stderr, "%s\n", qPrintable(message));
|
||||
fflush(stderr);
|
||||
}
|
||||
#elif defined(Q_OS_WIN)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <Windows.h>
|
||||
void QsDebugOutput::output( const QString& message )
|
||||
{
|
||||
OutputDebugStringW(reinterpret_cast<const WCHAR*>(message.utf16()));
|
||||
OutputDebugStringW(L"\n");
|
||||
WriteConsoleW(GetStdHandle(STD_ERROR_HANDLE), message.utf16(), message.size(), NULL, NULL);
|
||||
WriteConsoleW(GetStdHandle(STD_ERROR_HANDLE), L"\n", 1, NULL, NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
const char* const QsLogging::DebugOutputDestination::Type = "console";
|
||||
|
Loading…
x
Reference in New Issue
Block a user