From 1bfdff87ab0c97d0d1005db2759da667b7a9230c Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 7 Dec 2024 15:22:29 +0200 Subject: [PATCH] Fixed ring buffer sink --- include/spdlog/sinks/ringbuffer_sink.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/spdlog/sinks/ringbuffer_sink.h b/include/spdlog/sinks/ringbuffer_sink.h index dd2eed80..bab2cb40 100644 --- a/include/spdlog/sinks/ringbuffer_sink.h +++ b/include/spdlog/sinks/ringbuffer_sink.h @@ -10,7 +10,7 @@ #include "../details/async_log_msg.h" #include "../details/circular_q.h" #include "../details/null_mutex.h" -#include "./base_sink.h" +#include "base_sink.h" namespace spdlog { namespace sinks { @@ -26,7 +26,7 @@ public: explicit ringbuffer_sink(size_t n_items) : q_{n_items} {} - void drain_raw(std::function callback) { + void drain_raw(std::function callback) { std::lock_guard lock(base_sink::mutex_); while (!q_.empty()) { callback(q_.front()); @@ -46,11 +46,11 @@ public: } protected: - void sink_it_(const details::log_msg &msg) override { q_.push_back(details::log_msg_buffer{msg}); } + void sink_it_(const details::log_msg &msg) override { q_.push_back(details::async_log_msg{details::async_log_msg::msg_type::log, msg}); } void flush_() override {} private: - details::circular_q q_; + details::circular_q q_; }; using ringbuffer_sink_mt = ringbuffer_sink;