3#include <llvm/Support/Debug.h>
4#include <llvm/Support/Error.h>
5#include <llvm/Support/FormatAdapters.h>
6#include <llvm/Support/FormatVariadic.h>
24 const llvm::formatv_object_base &Message) = 0;
33template <
typename T>
T &&
wrap(
T &&
V) {
return std::forward<T>(
V); }
37template <
typename...
Ts>
43llvm::Error
error(std::error_code, std::string &&);
69template <
typename...
Ts>
78 llvm::inconvertibleErrorCode(),
82inline llvm::Error
error(std::error_code EC, std::string
Msg) {
112 const llvm::formatv_object_base &Message)
override;
116 llvm::raw_ostream &Logs;
Interface to allow custom logging in clangd.
virtual ~Logger()=default
static char indicator(Level L)
virtual void log(Level, const char *Fmt, const llvm::formatv_object_base &Message)=0
Implementations of this method must be thread-safe.
Only one LoggingSession can be active at a time.
LoggingSession & operator=(LoggingSession &&)=delete
LoggingSession(LoggingSession &&)=delete
LoggingSession(LoggingSession const &)=delete
LoggingSession & operator=(LoggingSession const &)=delete
LoggingSession(Logger &Instance)
void log(Level, const char *Fmt, const llvm::formatv_object_base &Message) override
Write a line to the logging stream.
StreamLogger(llvm::raw_ostream &Logs, Logger::Level MinLevel)
void logImpl(Logger::Level, const char *Fmt, const llvm::formatv_object_base &)
const char * debugType(const char *Filename)
void log(Logger::Level L, const char *Fmt, Ts &&...Vals)
llvm::Error error(std::error_code, std::string &&)
Whether current platform treats paths case insensitively.
llvm::Error error(std::error_code EC, const char *Fmt, Ts &&...Vals)
bool fromJSON(const llvm::json::Value &, URIForFile &, llvm::json::Path)
void elog(const char *Fmt, Ts &&...Vals)
void vlog(const char *Fmt, Ts &&...Vals)
void log(const char *Fmt, Ts &&...Vals)