MCPcopy Create free account
hub / github.com/TheImagingSource/tiscamera / async_example

Function async_example

external/spdlog/example/example.cpp:142–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140
141#include "spdlog/async.h"
142void async_example()
143{
144 // Default thread pool settings can be modified *before* creating the async logger:
145 // spdlog::init_thread_pool(32768, 1); // queue with max 32k items 1 backing thread.
146 auto async_file = spdlog::basic_logger_mt<spdlog::async_factory>("async_file_logger", "logs/async_log.txt");
147 // alternatively:
148 // auto async_file = spdlog::create_async<spdlog::sinks::basic_file_sink_mt>("async_file_logger", "logs/async_log.txt");
149
150 for (int i = 1; i < 101; ++i)
151 {
152 async_file->info("Async message #{}", i);
153 }
154}
155
156// Log binary data as hex.
157// Many types of std::container<char> types can be used.

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected