Rename async with_sink to with
This commit is contained in:
parent
035efac8bc
commit
0d780b0b58
@ -120,7 +120,7 @@ void callback_example() {
|
||||
#include "spdlog/sinks/async_sink.h"
|
||||
void async_example() {
|
||||
using spdlog::sinks::async_sink;
|
||||
auto sink = async_sink::with_sink<basic_file_sink_mt>("logs/async_log.txt", true);
|
||||
auto sink = async_sink::with<basic_file_sink_mt>("logs/async_log.txt", true);
|
||||
auto logger = std::make_shared<spdlog::logger>("async_logger", sink);
|
||||
for (int i = 1; i < 101; ++i) {
|
||||
logger->info("Async message #{}", i);
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
|
||||
// create an async_sink with one backend sink
|
||||
template <typename Sink, typename... SinkArgs>
|
||||
static std::shared_ptr<async_sink> with_sink(SinkArgs &&...sink_args) {
|
||||
static std::shared_ptr<async_sink> with(SinkArgs &&...sink_args) {
|
||||
config cfg{};
|
||||
cfg.sinks.emplace_back(std::make_shared<Sink>(std::forward<SinkArgs>(sink_args)...));
|
||||
return std::make_shared<async_sink>(cfg);
|
||||
|
@ -99,7 +99,7 @@ TEST_CASE("clone async", "[clone]") {
|
||||
{
|
||||
auto cfg = spdlog::sinks::async_sink::config();
|
||||
cfg.sinks.push_back(test_sink);
|
||||
auto async_sink = spdlog::sinks::async_sink::with_sink<test_sink_mt>();
|
||||
auto async_sink = spdlog::sinks::async_sink::with<test_sink_mt>();
|
||||
auto logger = spdlog::create<spdlog::sinks::async_sink>("orig", cfg);
|
||||
logger->set_pattern("*** %v ***");
|
||||
auto cloned = logger->clone("clone");
|
||||
|
Loading…
Reference in New Issue
Block a user