Added [[nodiscard]] and made should_flush_ const

This commit is contained in:
gabime 2024-11-29 16:11:13 +02:00
parent 15814dba5b
commit bb3d25b626
2 changed files with 2 additions and 2 deletions

View File

@ -209,7 +209,7 @@ protected:
}
}
virtual void flush_();
bool should_flush_(const details::log_msg &msg);
[[nodiscard]] bool should_flush_(const details::log_msg &msg) const;
// handle errors during logging.
// default handler prints the error to stderr at max rate of 1 message/sec.

View File

@ -81,7 +81,7 @@ void logger::flush_() {
}
}
bool logger::should_flush_(const details::log_msg &msg) {
bool logger::should_flush_(const details::log_msg &msg) const {
auto flush_level = flush_level_.load(std::memory_order_relaxed);
return (msg.log_level >= flush_level) && (msg.log_level != level::off);
}