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() {
|
||||
if (!file)
|
||||
return;
|
||||
std::lock_guard<std::mutex> lock(mtx);
|
||||
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)
|
||||
abort();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user