Added [[nodiscard]] and made should_flush_ const

docs2.x
gabime 9 months ago
parent 15814dba5b
commit bb3d25b626

@ -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.

@ -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);
}

Loading…
Cancel
Save