diff --git a/include/spdlog/sinks/ringbuffer_sink-inl.h b/include/spdlog/sinks/ringbuffer_sink-inl.h deleted file mode 100644 index 7f4f48aa..00000000 --- a/include/spdlog/sinks/ringbuffer_sink-inl.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) - -#pragma once - -//#ifndef SPDLOG_HEADER_ONLY -//#include "spdlog/sinks/ringbuffer_sink.h" -//#endif - -#include "spdlog/common.h" - -namespace spdlog { -namespace sinks { - -template -SPDLOG_INLINE ringbuffer_sink::ringbuffer_sink(size_t n_items) -{ - buf_ = details::circular_q(n_items); -} - -template -SPDLOG_INLINE void ringbuffer_sink::sink_it_(const details::log_msg &msg) -{ - buf_.push_back(details::log_msg_buffer{msg}); -} - -template -SPDLOG_INLINE std::vector ringbuffer_sink::formatted_messages(size_t lim) -{ - std::lock_guard lock(base_sink::mutex_); - auto n_items = lim > 0 ? (std::min)(lim, buf_.size()) : buf_.size(); - std::vector ret; - ret.reserve(n_items); - for (size_t i = 0; i < n_items; i++) - { - memory_buf_t formatted; - base_sink::formatter_->format(buf_.at(i), formatted); - ret.push_back(fmt::to_string(formatted)); - } - return ret; -} - -template -SPDLOG_INLINE std::vector ringbuffer_sink::raw_messages(size_t lim) -{ - std::lock_guard lock(base_sink::mutex_); - auto n_items = lim > 0 ? (std::min)(lim, buf_.size()) : buf_.size(); - std::vector ret; - ret.reserve(n_items); - for (size_t i = 0; i < n_items; i++) - { - ret.push_back(buf_.at(i)); - } - return ret; -} - -} // namespace sinks -} // namespace spdlog