feat(logger): special case logging to cerr, mostly for Windows terminal

This commit is contained in:
Marcus Holland-Moritz 2024-01-20 20:52:31 +01:00
parent 90c8fcba2a
commit 1e319bbf62

View File

@ -116,8 +116,11 @@ void stream_logger::postamble(std::ostream&) {}
std::string_view stream_logger::get_newline() const { return "\n"; }
void stream_logger::write_nolock(std::string_view output) {
// TODO
os_ << output;
if (&os_ == &std::cerr) {
fmt::print(stderr, "{}", output);
} else {
os_ << output;
}
}
void stream_logger::write(level_type level, const std::string& output,