[PATCH] D48881: [clangd] Avoid collecting symbols from broken TUs in global-symbol-builder.
Ilya Biryukov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 4 02:49:57 PDT 2018
ilya-biryukov added inline comments.
================
Comment at: clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp:88
+ (CI.getDiagnosticClient().getNumErrors() > 0)) {
+ llvm::errs() << "Found errors in the translation unit. Igoring "
+ "collected symbols...\n";
----------------
ioeric wrote:
> ilya-biryukov wrote:
> > NIT: Maybe use clangd's `log` here? To get timestamps in the output, etc.
> The default logger doesn't seem to add timestamp? I'll keep `llvm::errs()` here for consistency in this file.
> The default logger doesn't seem to add timestamp?
Ah, yes, it's the `JSONOutput` that adds timestamps.... Sorry.
> I'll keep llvm::errs() here for consistency in this file.
We write to `stderr` at the bottom of the file to show errors to the user.
This instance looks much more like a logging routine.
Since our dependencies (e.g. `SymbolCollector`) use logs, I'd argue it's actually **more** consistent across the program to use `log` here as well. E.g. if someone adds a `LoggingSession` that writes timestamps, not only SymbolCollector logs should start showing those, but this one as well.
Repository:
rL LLVM
https://reviews.llvm.org/D48881
More information about the llvm-commits
mailing list