Refactored message counter a little

This commit is contained in:
gabime
2017-05-21 02:45:08 +03:00
parent 7da3e47ddc
commit 361344912e
2 changed files with 6 additions and 13 deletions

View File

@@ -87,6 +87,9 @@ inline void spdlog::async_logger::_sink_it(details::log_msg& msg)
{
try
{
#if defined(SPDLOG_ENABLE_MESSAGE_COUNTER)
msg.msg_id = _msg_counter.fetch_add(1, std::memory_order_relaxed);
#endif
_async_log_helper->log(msg);
if (_should_flush_on(msg))
_async_log_helper->flush(false); // do async flush