[PATCH] D47643: Rewrite JSON dispatcher loop using C IO (FILE*) instead of std::istream.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 4 07:19:41 PDT 2018


sammccall added inline comments.


================
Comment at: clangd/JSONRPCDispatcher.cpp:70
   }
-  log(llvm::Twine("--> ") + S);
+  log(llvm::Twine("--> ") + S + "\n");
 }
----------------
ilya-biryukov wrote:
> Log adds a newline for us, right? Why do we want two newlines here?
Oops, forgot to mention in the description... Yes this is a deliberate double-newline.

While I was here, I removed the trailing `\n` in most `log()` calls, but decided to *keep* the one after `<--`and *add* one after `-->`, because they help visually separate the big JSON payloads from the rest of the log, which is useful while scanning.

Happy to remove these special cases, or back out all the unrelated newline changes if you prefer.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D47643





More information about the cfe-commits mailing list