add an option to warn about discarded messages

when using async_logger with async_overflow_policy::discard_log_msg each discarded
message will be counted and warning will be printed by the worker thread

this new feature is disabled by default - as it may have a performance hit when discarding messages
This commit is contained in:
Alexander Zilberkant
2017-05-11 23:52:42 +03:00
parent 47006c4e8e
commit 0aeaf9e28e
2 changed files with 41 additions and 8 deletions

View File

@@ -114,3 +114,10 @@
//
// #define SPDLOG_FINAL final
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Uncomment count in print warning message about number of dropped messages.
// Only relevant for async_logger with async_overflow_policy::discard_log_msg
//
#define SPDLOG_ASYNC_COUNT_DISCARDED_MSG
///////////////////////////////////////////////////////////////////////////////