[clangd] Use buffered llvm::errs() in the clangd binary.

Summary: Unbuffered stream can cause significant (non-deterministic) latency for the logger.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Differential Revision: https://reviews.llvm.org/D51349

llvm-svn: 340822
This commit is contained in:
Eric Liu 2018-08-28 13:15:50 +00:00
parent 29c5d5aa36
commit 4e4e5a4e8a
1 changed files with 3 additions and 0 deletions

View File

@ -259,6 +259,9 @@ int main(int argc, char *argv[]) {
if (Tracer)
TracingSession.emplace(*Tracer);
// Use buffered stream to stderr (we still flush each log message). 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);