forked from qt-creator/qt-creator
Clang: forward clangbackend QDebug messages to stdout
...to see them in both qtcreator application output and DebugView. clangbackend is a separate process which provides QtCreator stdout and stderr channels so we need to have QDebug messages there in order to receive them. Change-Id: I2edc4de1ca203b061395b0b3070e4471348eaad7 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -33,6 +33,8 @@
|
|||||||
#include <clangcodemodelserver.h>
|
#include <clangcodemodelserver.h>
|
||||||
#include <clangcodemodelclientproxy.h>
|
#include <clangcodemodelclientproxy.h>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
using ClangBackEnd::ClangCodeModelClientProxy;
|
using ClangBackEnd::ClangCodeModelClientProxy;
|
||||||
using ClangBackEnd::ClangCodeModelServer;
|
using ClangBackEnd::ClangCodeModelServer;
|
||||||
using ClangBackEnd::ConnectionServer;
|
using ClangBackEnd::ConnectionServer;
|
||||||
@@ -53,8 +55,20 @@ QString processArguments(QCoreApplication &application)
|
|||||||
return parser.positionalArguments().first();
|
return parser.positionalArguments().first();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
static void messageOutput(QtMsgType type, const QMessageLogContext &, const QString &msg)
|
||||||
|
{
|
||||||
|
std::wcout << msg.toStdWString() << std::endl;
|
||||||
|
if (type == QtFatalMsg)
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
qInstallMessageHandler(messageOutput);
|
||||||
|
#endif
|
||||||
QLoggingCategory::setFilterRules(QStringLiteral("qtc.*.debug=false"));
|
QLoggingCategory::setFilterRules(QStringLiteral("qtc.*.debug=false"));
|
||||||
|
|
||||||
QCoreApplication::setOrganizationName(QStringLiteral("QtProject"));
|
QCoreApplication::setOrganizationName(QStringLiteral("QtProject"));
|
||||||
|
|||||||
Reference in New Issue
Block a user