[PATCH] D49008: [clangd] Upgrade logging facilities with levels and formatv.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 6 01:40:16 PDT 2018


sammccall created this revision.
Herald added subscribers: cfe-commits, jkorous, MaskRay, ioeric, javed.absar, ilya-biryukov.

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.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D49008

Files:
  clangd/ClangdLSPServer.cpp
  clangd/ClangdServer.cpp
  clangd/ClangdUnit.cpp
  clangd/CodeComplete.cpp
  clangd/Compiler.cpp
  clangd/Diagnostics.cpp
  clangd/FileDistance.cpp
  clangd/FindSymbols.cpp
  clangd/GlobalCompilationDatabase.cpp
  clangd/JSONRPCDispatcher.cpp
  clangd/JSONRPCDispatcher.h
  clangd/Logger.cpp
  clangd/Logger.h
  clangd/Protocol.cpp
  clangd/ProtocolHandlers.cpp
  clangd/TUScheduler.cpp
  clangd/XRefs.cpp
  clangd/index/SymbolCollector.cpp
  clangd/tool/ClangdMain.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49008.154372.patch
Type: text/x-patch
Size: 29783 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180706/5c8d032a/attachment-0001.bin>


More information about the cfe-commits mailing list