[clangd] Upgrade logging facilities with levels and formatv.

Summary:
log() is split into four functions:
 - elog()/log()/vlog() have different severity levels, allowing filtering
 - dlog() is a lazy macro which uses LLVM_DEBUG - it logs to the logger, but
   conditionally based on -debug-only flag and is omitted in release builds

All logging functions use formatv-style format strings now, e.g:
  log("Could not resolve URI {0}: {1}", URI, Result.takeError());

Existing log sites have been split between elog/log/vlog by best guess.

This includes a workaround for passing Error to formatv that can be
simplified when D49170 or similar lands.

Subscribers: ilya-biryukov, javed.absar, ioeric, MaskRay, jkorous, cfe-commits

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

llvm-svn: 336785
diff --git a/clang-tools-extra/clangd/Protocol.cpp b/clang-tools-extra/clangd/Protocol.cpp
index a35e6ba..8d99e18 100644
--- a/clang-tools-extra/clangd/Protocol.cpp
+++ b/clang-tools-extra/clangd/Protocol.cpp
@@ -34,16 +34,17 @@
   if (auto S = E.getAsString()) {
     auto U = URI::parse(*S);
     if (!U) {
-      log("Failed to parse URI " + *S + ": " + llvm::toString(U.takeError()));
+      elog("Failed to parse URI {0}: {1}", *S, U.takeError());
       return false;
     }
     if (U->scheme() != "file" && U->scheme() != "test") {
-      log("Clangd only supports 'file' URI scheme for workspace files: " + *S);
+      elog("Clangd only supports 'file' URI scheme for workspace files: {0}",
+           *S);
       return false;
     }
     auto Path = URI::resolve(*U);
     if (!Path) {
-      log(llvm::toString(Path.takeError()));
+      log("{0}", Path.takeError());
       return false;
     }
     R = URIForFile(*Path);