Index: clangd/tool/ClangdMain.cpp =================================================================== --- clangd/tool/ClangdMain.cpp +++ clangd/tool/ClangdMain.cpp @@ -259,6 +259,9 @@ if (Tracer) TracingSession.emplace(*Tracer); + // Use buffered stream to stderr. Unbuffered stream can cause significant + // (non-deterministic) latency for the logger. + llvm::errs().SetBuffered(); JSONOutput Out(llvm::outs(), llvm::errs(), LogLevel, InputMirrorStream ? InputMirrorStream.getPointer() : nullptr, PrettyPrint);