From 292c808d141cf7adc9f2353aad3a3ca4b5db4d01 Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 28 Dec 2024 15:00:42 +0200 Subject: [PATCH] Fix example --- example/example.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); }