31 log_clock::time_point
time;
33 fmt::basic_memory_buffer<char, 176>
raw;
46 #if defined(_MSC_VER) && _MSC_VER <= 1800 50 thread_id(
other.thread_id),
60 msg_type =
other.msg_type;
63 thread_id =
other.thread_id;
65 msg_id =
other.msg_id;
66 source =
other.source;
70 #else // (_MSC_VER) && _MSC_VER <= 1800 80 , thread_id(m.thread_id)
129 if (threads_n == 0 || threads_n > 1000)
131 throw spdlog_ex(
"spdlog::thread_pool(): invalid threads_n param (valid " 134 for (
size_t i = 0; i < threads_n; i++)
145 for (
size_t i = 0; i < threads_.size(); i++)
150 for (
auto &
t : threads_)
166 post_async_msg_(
std::move(async_m), overflow_policy);
176 return q_.overrun_counter();
198 while (process_next_msg_()) {};
213 switch (incoming_async_msg.
msg_type)
223 incoming_async_msg.
worker_ptr->backend_flush_();
232 assert(
false &&
"Unexpected async_msg_type");
thread_pool(size_t q_max_items, size_t threads_n)
void post_flush(async_logger_ptr &&worker_ptr, async_overflow_policy overflow_policy)
void enqueue_nowait(T &&item)
void msg(const char *fmt,...)
async_msg(async_logger_ptr &&worker, async_msg_type the_type, details::log_msg &m)
void post_async_msg_(async_msg &&new_msg, async_overflow_policy overflow_policy)
log_clock::time_point time
async_logger_ptr worker_ptr
bool dequeue_for(T &popped_item, std::chrono::milliseconds wait_duration)
std::vector< std::thread > threads_
std::shared_ptr< spdlog::details::thread_pool > thread_pool()
async_msg(async_msg_type the_type)
second seconds
Alias for common language habits.
void append_string_view(spdlog::string_view_t view, fmt::basic_memory_buffer< char, Buffer_Size > &dest)
fmt::basic_memory_buffer< char, 176 > raw
fmt::string_view string_view_t
size_t thread_id() SPDLOG_NOEXCEPT
std::shared_ptr< spdlog::async_logger > async_logger_ptr
const string_view_t payload
async_msg(async_logger_ptr &&worker, async_msg_type the_type)
void post_log(async_logger_ptr &&worker_ptr, details::log_msg &msg, async_overflow_policy overflow_policy)
log_clock::time_point time