Skip to content

Commit

Permalink
Rename async with_sink to with
Browse files Browse the repository at this point in the history
  • Loading branch information
gabime committed Jan 2, 2025
1 parent 035efac commit 0d780b0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion include/spdlog/sinks/async_sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SPDLOG_API async_sink final : public sink {

// 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);
Expand Down
2 changes: 1 addition & 1 deletion tests/test_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 0d780b0

Please sign in to comment.