mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 10:31:34 +08:00
Added [[nodiscard]] and made should_flush_ const
This commit is contained in:
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…
Reference in New Issue
Block a user