Fix example
This commit is contained in:
parent
a7298c5b8f
commit
292c808d14
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user