ClangCodeModel: Make use of QLoggingCategory

Change-Id: I28d50e224803096c032ae6e387bf1346db4cc216
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-10-23 13:08:07 +02:00
parent 9cddeef036
commit bf3c55be42
7 changed files with 35 additions and 40 deletions

View File

@@ -40,7 +40,9 @@
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
static const bool DebugTiming = qgetenv("QTC_CLANG_VERBOSE") == "1";
#include <QLoggingCategory>
static Q_LOGGING_CATEGORY(log, "qtc.clangcodemodel.clangeditordocumentparser")
namespace {
@@ -91,20 +93,16 @@ void ClangEditorDocumentParser::update(CppTools::WorkingCopy workingCopy)
updateProjectPart();
const QStringList options = createOptions(filePath(), projectPart());
QTime t;
if (DebugTiming) {
qDebug("*** Reparse options (cmd line equivalent): %s",
commandLine(options, filePath()).toUtf8().constData());
t.start();
}
qCDebug(log, "Reparse options (cmd line equivalent): %s",
commandLine(options, filePath()).toUtf8().constData());
QTime t; t.start();
m_marker->setFileName(filePath());
m_marker->setCompilationOptions(options);
const Internal::UnsavedFiles unsavedFiles = Utils::createUnsavedFiles(workingCopy);
m_marker->reparse(unsavedFiles);
if (DebugTiming)
qDebug() << "*** Reparse took" << t.elapsed() << "ms.";
qCDebug(log) << "Reparse took" << t.elapsed() << "ms.";
}
QList<Diagnostic> ClangEditorDocumentParser::diagnostics() const