diff --git a/src/log.cc b/src/log.cc index a10a4a7d..38a71342 100644 --- a/src/log.cc +++ b/src/log.cc @@ -67,11 +67,14 @@ Message::Message(Verbosity verbosity, const char *file, int line) } Message::~Message() { - if (!file) - return; std::lock_guard 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(); }