mirror of
https://github.com/MaskRay/ccls.git
synced 2025-06-08 01:04:54 +00:00
log to stderr to forward to lsp client
This commit is contained in:
parent
7a79ed92b2
commit
3ae916cbfc
@ -67,11 +67,14 @@ Message::Message(Verbosity verbosity, const char *file, int line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Message::~Message() {
|
Message::~Message() {
|
||||||
if (!file)
|
|
||||||
return;
|
|
||||||
std::lock_guard<std::mutex> lock(mtx);
|
std::lock_guard<std::mutex> lock(mtx);
|
||||||
stream_ << '\n';
|
stream_ << '\n';
|
||||||
fputs(stream_.str().c_str(), file);
|
if (file) {
|
||||||
|
fputs(stream_.str().c_str(), file);
|
||||||
|
fflush(file);
|
||||||
|
}
|
||||||
|
fputs(stream_.str().c_str(), stderr);
|
||||||
|
fflush(stderr); // stderr is redirected to LSP client
|
||||||
if (verbosity_ == Verbosity_FATAL)
|
if (verbosity_ == Verbosity_FATAL)
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user