Added comment in ringbuffer_sink.h

This commit is contained in:
gabime 2023-09-01 16:28:31 +03:00
parent 8f7400731e
commit 11770fc7e5

View File

@ -16,7 +16,12 @@
namespace spdlog {
namespace sinks {
/*
* Ring buffer sink
* Ring buffer sink. Holds fixed amount of log messages in memory. When the buffer is full, new messages override the old ones.
* Useful for storing debug data in memory in case of error.
* Example:
* auto rb_sink = std::make_shared<spdlog::sinks::ringbuffer_sink_mt>(128);
* spdlog::logger logger("rb_logger", rb_sink);
* rb->drain([](const std::string_view msg) { process(msg);});
*/
template<typename Mutex>
class ringbuffer_sink final : public base_sink<Mutex>