clang-tools
7.0.0
|
Encapsulates output and logs streams and provides thread-safe access to them. More...
#include <JSONRPCDispatcher.h>
Public Member Functions | |
JSONOutput (llvm::raw_ostream &Outs, llvm::raw_ostream &Logs, Logger::Level MinLevel, llvm::raw_ostream *InputMirror=nullptr, bool Pretty=false) | |
void | writeMessage (const llvm::json::Value &Result) |
Emit a JSONRPC message. More... | |
void | log (Level, const llvm::formatv_object_base &Message) override |
Write a line to the logging stream. More... | |
void | mirrorInput (const Twine &Message) |
Mirror Message into InputMirror stream. More... | |
![]() | |
virtual | ~Logger ()=default |
Public Attributes | |
const bool | Pretty |
Additional Inherited Members | |
![]() | |
enum | Level { Debug, Verbose, Info, Error } |
![]() | |
static char | indicator (Level L) |
Encapsulates output and logs streams and provides thread-safe access to them.
Definition at line 28 of file JSONRPCDispatcher.h.
|
inline |
Definition at line 32 of file JSONRPCDispatcher.h.
References log(), clang::tidy::modernize::Message, mirrorInput(), and writeMessage().
|
overridevirtual |
Write a line to the logging stream.
Implements clang::clangd::Logger.
Definition at line 75 of file JSONRPCDispatcher.cpp.
References clang::clangd::detail::log().
Referenced by JSONOutput().
void JSONOutput::mirrorInput | ( | const Twine & | Message | ) |
Mirror Message
into InputMirror stream.
Does nothing if InputMirror is null. Unlike other methods of JSONOutput, mirrorInput is not thread-safe.
Definition at line 87 of file JSONRPCDispatcher.cpp.
References clang::clangd::elog(), clang::clangd::detail::log(), clang::tidy::modernize::Message, and clang::clangd::reply().
Referenced by JSONOutput().
void JSONOutput::writeMessage | ( | const llvm::json::Value & | Result | ) |
Emit a JSONRPC message.
Definition at line 58 of file JSONRPCDispatcher.cpp.
References clang::tidy::modernize::Message, and clang::clangd::vlog().
Referenced by JSONOutput(), and clang::clangd::ClangdLSPServer::run().
const bool clang::clangd::JSONOutput::Pretty |
Definition at line 50 of file JSONRPCDispatcher.h.