diff --git a/example/example.cpp b/example/example.cpp index 4a6e0951..4ced545c 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -119,9 +119,9 @@ void callback_example() { #include "spdlog/sinks/async_sink.h" void async_example() { - auto logger = spdlog::create_async("some_logger"); - auto file_sink = std::make_shared("logs/async_log.txt", true); - logger->sinks().push_back(file_sink); + using spdlog::sinks::async_sink; + auto sink = async_sink::with_sink("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); }