From c77b87fb87cb6eb80f20c41d85c99ff782a4db22 Mon Sep 17 00:00:00 2001 From: F1F88 <0xf1f88@gmail.com> Date: Wed, 11 Dec 2024 23:37:45 +0800 Subject: [PATCH] Implementing the backend_worker class --- include/spdlog/async_logger.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/spdlog/async_logger.h b/include/spdlog/async_logger.h index 846c4c6f..772555e3 100644 --- a/include/spdlog/async_logger.h +++ b/include/spdlog/async_logger.h @@ -15,6 +15,7 @@ // destructing.. #include +#include namespace spdlog { @@ -30,10 +31,8 @@ namespace details { class thread_pool; } -class SPDLOG_API async_logger final : public std::enable_shared_from_this, - public logger { - friend class details::thread_pool; - +class SPDLOG_API async_logger final : public logger, + public details::backend_worker { public: template async_logger(std::string logger_name, @@ -60,8 +59,8 @@ public: protected: void sink_it_(const details::log_msg &msg) override; void flush_() override; - void backend_sink_it_(const details::log_msg &incoming_log_msg); - void backend_flush_(); + void backend_sink_it_(const details::log_msg &incoming_log_msg) override; + void backend_flush_() override; private: std::weak_ptr thread_pool_;