|
|
@ -25,6 +25,8 @@ SPDLOG_INLINE spdlog::async_logger::async_logger(
|
|
|
|
|
|
|
|
|
|
|
|
// send the log message to the thread pool
|
|
|
|
// send the log message to the thread pool
|
|
|
|
SPDLOG_INLINE void spdlog::async_logger::sink_it_(const details::log_msg &msg)
|
|
|
|
SPDLOG_INLINE void spdlog::async_logger::sink_it_(const details::log_msg &msg)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SPDLOG_TRY
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (auto pool_ptr = thread_pool_.lock())
|
|
|
|
if (auto pool_ptr = thread_pool_.lock())
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -35,9 +37,13 @@ SPDLOG_INLINE void spdlog::async_logger::sink_it_(const details::log_msg &msg)
|
|
|
|
throw_spdlog_ex("async log: thread pool doesn't exist anymore");
|
|
|
|
throw_spdlog_ex("async log: thread pool doesn't exist anymore");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SPDLOG_LOGGER_CATCH(msg.source)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// send flush request to the thread pool
|
|
|
|
// send flush request to the thread pool
|
|
|
|
SPDLOG_INLINE void spdlog::async_logger::flush_()
|
|
|
|
SPDLOG_INLINE void spdlog::async_logger::flush_()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SPDLOG_TRY
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (auto pool_ptr = thread_pool_.lock())
|
|
|
|
if (auto pool_ptr = thread_pool_.lock())
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -48,6 +54,8 @@ SPDLOG_INLINE void spdlog::async_logger::flush_()
|
|
|
|
throw_spdlog_ex("async flush: thread pool doesn't exist anymore");
|
|
|
|
throw_spdlog_ex("async flush: thread pool doesn't exist anymore");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SPDLOG_LOGGER_CATCH(source_loc())
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// backend functions - called from the thread pool to do the actual job
|
|
|
|
// backend functions - called from the thread pool to do the actual job
|
|
|
|