if (CXXIdx->isOptEnabled(CXGlobalOpt_ThreadBackgroundPriorityForIndexing))
setThreadBackgroundPriority();
- CaptureDiagnosticConsumer *CaptureDiag = new CaptureDiagnosticConsumer();
+ bool CaptureDiagnostics = !Logger::isLoggingEnabled();
+
+ CaptureDiagnosticConsumer *CaptureDiag = 0;
+ if (CaptureDiagnostics)
+ CaptureDiag = new CaptureDiagnosticConsumer();
// Configure the diagnostics.
IntrusiveRefCntPtr<DiagnosticsEngine>
CInvok->getDiagnosticOpts().IgnoreWarnings = true;
ASTUnit *Unit = ASTUnit::create(CInvok.getPtr(), Diags,
- /*CaptureDiagnostics=*/true,
+ CaptureDiagnostics,
/*UserFilesAreVolatile=*/true);
OwningPtr<CXTUOwner> CXTU(new CXTUOwner(MakeCXTranslationUnit(CXXIdx, Unit)));
Persistent,
CXXIdx->getClangResourcesPath(),
OnlyLocalDecls,
- /*CaptureDiagnostics=*/true,
+ CaptureDiagnostics,
PrecompilePreamble,
CacheCodeCompletionResults,
/*IncludeBriefCommentsInCodeCompletion=*/false,