spdlog
spdlog copied to clipboard
Interface for notifying that spdlog drops a log?
Blocking mode is dangerous for services, but when selecting overrun mode, there is a risk of losing logs.
Not sure if there is an interface (ex: pass a callback function?) when spdlog is dropping a log.
Example callback interface?:
void func(const Log& log) noexcept {
}
There is no API to notify asynchronous log drops.
However, spdlog::details::thread_pool::overrun_counter()
lets you know how many logs were dropped due to overruns.
https://github.com/gabime/spdlog/blob/f44fa31f5110331af196d0ed7f00ae1c7b8ef3cc/include/spdlog/details/thread_pool.h#L99-L100