Move ringbuffer_sink to spdlog::details::circular_q, enhance its API: size(), at(i)

This commit is contained in:
Václav Šmilauer
2019-11-08 19:25:31 +01:00
parent acf32be842
commit 6f0cb6365e
3 changed files with 20 additions and 9 deletions

View File

@@ -6,13 +6,12 @@
#include "spdlog/details/null_mutex.h"
#include "spdlog/sinks/base_sink.h"
#include "spdlog/details/synchronous_factory.h"
#include "spdlog/details/circular_q.h"
#include <mutex>
#include <string>
#include <vector>
#include<boost/circular_buffer.hpp>
namespace spdlog {
namespace sinks {
/*
@@ -30,7 +29,7 @@ protected:
void flush_() override {};
private:
boost::circular_buffer<std::string> buf;
details::circular_q<std::string> buf;
};
using ringbuffer_sink_mt = ringbuffer_sink<std::mutex>;