Clangbackend: Use Qt debugging instead of std::cerr

The arguments passed to libclang were only passed to std::cerr,
which and never reached Windows logging.

On Windows the clang*.exe have a qMessageHandler which forwards
the message to windows logging and std::cerr.

Change-Id: I97b0856ae2b3f44a991c9d292a15db9f3b071a0d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Cristian Adam
2019-09-24 10:46:13 +02:00
parent bcaeb73e68
commit 1e9b1dcaec

View File

@@ -32,9 +32,7 @@
#include <utils/qtcprocess.h>
#include <QByteArray>
#include <QtCore/qdebug.h>
#include <iostream>
#include <QDebug>
static QList<QByteArray> splitArgs(QString &argsString)
{
@@ -121,11 +119,10 @@ static Utf8String maybeQuoted(const char *argumentAsCString)
void CommandLineArguments::print() const
{
using namespace std;
auto cerr = qCritical();
cerr << "Arguments to libclang:";
for (const auto &argument : m_arguments)
cerr << ' ' << maybeQuoted(argument).constData();
cerr << endl;
cerr.noquote() << maybeQuoted(argument).constData();
}
} // namespace ClangBackEnd