20 :
logger(
std::move(logger_name), begin, end)
21 , thread_pool_(
std::move(tp))
22 , overflow_policy_(overflow_policy)
34 :
async_logger(
std::move(logger_name), {std::move(single_sink)}, std::move(tp), overflow_policy)
41 #if defined(SPDLOG_ENABLE_MESSAGE_COUNTER) 44 if (
auto pool_ptr = thread_pool_.lock())
46 pool_ptr->post_log(shared_from_this(), msg, overflow_policy_);
50 throw spdlog_ex(
"async log: thread pool doesn't exist anymore");
57 if (
auto pool_ptr = thread_pool_.lock())
59 pool_ptr->post_flush(shared_from_this(), overflow_policy_);
63 throw spdlog_ex(
"async flush: thread pool doesn't exist anymore");
76 if (s->should_log(incoming_log_msg.
level))
78 s->log(incoming_log_msg);
104 auto cloned = std::make_shared<spdlog::async_logger>(std::move(new_name),
sinks_.begin(),
sinks_.end(), thread_pool_, overflow_policy_);
106 cloned->set_level(this->
level());
109 return std::move(cloned);
auto begin(const C &c) -> decltype(c.begin())
level::level_enum flush_level() const
void incr_msg_counter_(details::log_msg &msg)
log_err_handler error_handler() const
std::initializer_list< sink_ptr > sinks_init_list
#define SPDLOG_CATCH_AND_HANDLE
std::shared_ptr< sinks::sink > sink_ptr
std::vector< sink_ptr > sinks_
std::shared_ptr< logger > clone(std::string new_name) override
bool should_flush_(const details::log_msg &msg)
async_logger(std::string logger_name, It begin, It end, std::weak_ptr< details::thread_pool > tp, async_overflow_policy overflow_policy=async_overflow_policy::block)
void sink_it_(details::log_msg &msg) override
level::level_enum level() const
void backend_log_(const details::log_msg &incoming_log_msg)
auto end(const C &c) -> decltype(c.end())