CppTools: Make use of QLoggingCategory

...for document processing and highlighting.

Change-Id: I31d42a5a5010260643ec76688080fd14a486f7e3
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-10-23 12:39:59 +02:00
parent 8d6b43bc2a
commit 9cddeef036
6 changed files with 29 additions and 48 deletions

View File

@@ -42,6 +42,7 @@
#include <QCoreApplication>
#include <QCryptographicHash>
#include <QDir>
#include <QLoggingCategory>
#include <QTextCodec>
/*!
@@ -61,6 +62,8 @@ using namespace CppTools::Internal;
typedef Document::DiagnosticMessage Message;
static Q_LOGGING_CATEGORY(log, "qtc.cpptools.sourceprocessor")
namespace {
inline QByteArray generateFingerPrint(const QList<Macro> &definedMacros, const QByteArray &code)
@@ -112,7 +115,6 @@ inline const Macro revision(const WorkingCopy &workingCopy,
CppSourceProcessor::CppSourceProcessor(const Snapshot &snapshot, DocumentCallback documentFinished)
: m_snapshot(snapshot),
m_documentFinished(documentFinished),
m_dumpFileNameWhileParsing(false),
m_preprocess(this, &m_env),
m_revision(0),
m_defaultCodec(Core::EditorManager::defaultTextCodec())
@@ -445,8 +447,7 @@ void CppSourceProcessor::sourceNeeded(unsigned line, const QString &fileName, In
return;
}
if (m_dumpFileNameWhileParsing)
qDebug() << "Parsing:" << absoluteFileName << "contents:" << contents.size() << "bytes";
qCDebug(log) << "Parsing:" << absoluteFileName << "contents:" << contents.size() << "bytes";
Document::Ptr document = Document::create(absoluteFileName);
document->setRevision(m_revision);