From 0d780b0b58d782223b1cff1ae009a938919ea60f Mon Sep 17 00:00:00 2001 From: gabime Date: Thu, 2 Jan 2025 18:45:59 +0200 Subject: [PATCH] Rename async with_sink to with --- example/example.cpp | 2 +- include/spdlog/sinks/async_sink.h | 2 +- tests/test_misc.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/example.cpp b/example/example.cpp index 15e620635..f1dafa2cc 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -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("logs/async_log.txt", true); + auto sink = async_sink::with("logs/async_log.txt", true); auto logger = std::make_shared("async_logger", sink); for (int i = 1; i < 101; ++i) { logger->info("Async message #{}", i); diff --git a/include/spdlog/sinks/async_sink.h b/include/spdlog/sinks/async_sink.h index 29458f113..e782620a0 100644 --- a/include/spdlog/sinks/async_sink.h +++ b/include/spdlog/sinks/async_sink.h @@ -44,7 +44,7 @@ class SPDLOG_API async_sink final : public sink { // create an async_sink with one backend sink template - static std::shared_ptr with_sink(SinkArgs &&...sink_args) { + static std::shared_ptr with(SinkArgs &&...sink_args) { config cfg{}; cfg.sinks.emplace_back(std::make_shared(std::forward(sink_args)...)); return std::make_shared(cfg); diff --git a/tests/test_misc.cpp b/tests/test_misc.cpp index 5f2f627b1..304ed9c4b 100644 --- a/tests/test_misc.cpp +++ b/tests/test_misc.cpp @@ -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(); + auto async_sink = spdlog::sinks::async_sink::with(); auto logger = spdlog::create("orig", cfg); logger->set_pattern("*** %v ***"); auto cloned = logger->clone("clone");