From 11770fc7e56d8d7e85ea40a83c7616afe736d147 Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 1 Sep 2023 16:28:31 +0300 Subject: [PATCH] Added comment in ringbuffer_sink.h --- include/spdlog/sinks/ringbuffer_sink.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/spdlog/sinks/ringbuffer_sink.h b/include/spdlog/sinks/ringbuffer_sink.h index 844322b5..beaa793a 100644 --- a/include/spdlog/sinks/ringbuffer_sink.h +++ b/include/spdlog/sinks/ringbuffer_sink.h @@ -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(128); + * spdlog::logger logger("rb_logger", rb_sink); + * rb->drain([](const std::string_view msg) { process(msg);}); */ template class ringbuffer_sink final : public base_sink