Fix example

pull/3309/head
gabime 8 months ago
parent a7298c5b8f
commit 292c808d14

@ -119,9 +119,9 @@ void callback_example() {
#include "spdlog/sinks/async_sink.h" #include "spdlog/sinks/async_sink.h"
void async_example() { void async_example() {
auto logger = spdlog::create_async("some_logger"); using spdlog::sinks::async_sink;
auto file_sink = std::make_shared<basic_file_sink_mt>("logs/async_log.txt", true); auto sink = async_sink::with_sink<basic_file_sink_mt>("logs/async_log.txt", true);
logger->sinks().push_back(file_sink); auto logger = std::make_shared<spdlog::logger>("async_logger", sink);
for (int i = 1; i < 101; ++i) { for (int i = 1; i < 101; ++i) {
logger->info("Async message #{}", i); logger->info("Async message #{}", i);
} }

Loading…
Cancel
Save