[PATCH] D44226: [clangd] Add -log-to-stderr option

Simon Marchi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 7 13:54:17 PST 2018

simark created this revision.
Herald added subscribers: cfe-commits, ioeric, JDevlieghere, jkorous-apple, ilya-biryukov, klimek.

Currently, clangd prints all the LSP communication on stderr.  While
this is good for developping, I don't think it's good as a general
default.  For example, we are integrating clangd (and other language
servers) in an IDE, and we print everything the language servers send on
their stderr on our own stderr.  Printing the whole LSP communication
adds a lot of noise.  If there are actual error messages to be printed,
then it makes sense to output them on stderr.

Also, an IDE or tool that integrates many language servers will likely
have its own way of logging LSP communication in a consistent way, so
it's better to leave it to that tool to log the LSP communication if it
wants to.

An alternative would be to introduce log levels (debug, info, warning,
error), and output LSP communications only at the debug log level.

Signed-off-by: Simon Marchi <simon.marchi at ericsson.com>

  rCTE Clang Tools Extra



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44226.137473.patch
Type: text/x-patch
Size: 4363 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180307/e98629b8/attachment.bin>

More information about the cfe-commits mailing list