Skip to content

Commit

Permalink
Fix code formatting of async_logger-inl.h
Browse files Browse the repository at this point in the history
  • Loading branch information
gabime authored Sep 21, 2023
1 parent b5b5043 commit 1d6dbc2
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions include/spdlog/async_logger-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,37 @@ SPDLOG_INLINE spdlog::async_logger::async_logger(
{}

// send the log message to the thread pool
SPDLOG_INLINE void spdlog::async_logger::sink_it_(const details::log_msg &msg){
SPDLOG_TRY{if (auto pool_ptr = thread_pool_.lock()){pool_ptr->post_log(shared_from_this(), msg, overflow_policy_);
}
else
SPDLOG_INLINE void spdlog::async_logger::sink_it_(const details::log_msg &msg)
{
throw_spdlog_ex("async log: thread pool doesn't exist anymore");
}
}
SPDLOG_LOGGER_CATCH(msg.source)
SPDLOG_TRY
{
if (auto pool_ptr = thread_pool_.lock())
{
pool_ptr->post_log(shared_from_this(), msg, overflow_policy_);
}
else
{
throw_spdlog_ex("async log: thread pool doesn't exist anymore");
}
}
SPDLOG_LOGGER_CATCH(msg.source)
}

// send flush request to the thread pool
SPDLOG_INLINE void spdlog::async_logger::flush_(){
SPDLOG_TRY{if (auto pool_ptr = thread_pool_.lock()){pool_ptr->post_flush(shared_from_this(), overflow_policy_);
}
else
SPDLOG_INLINE void spdlog::async_logger::flush_()
{
throw_spdlog_ex("async flush: thread pool doesn't exist anymore");
}
}
SPDLOG_LOGGER_CATCH(source_loc())
SPDLOG_TRY
{
if (auto pool_ptr = thread_pool_.lock())
{
pool_ptr->post_flush(shared_from_this(), overflow_policy_);
}
else
{
throw_spdlog_ex("async flush: thread pool doesn't exist anymore");
}
}
SPDLOG_LOGGER_CATCH(source_loc())
}

//
Expand Down

0 comments on commit 1d6dbc2

Please sign in to comment.