Skip to content

Commit

Permalink
Fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
gabime committed Dec 28, 2024
1 parent a7298c5 commit 292c808
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<basic_file_sink_mt>("logs/async_log.txt", true);
logger->sinks().push_back(file_sink);
using spdlog::sinks::async_sink;
auto sink = async_sink::with_sink<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

0 comments on commit 292c808

Please sign in to comment.