From 96616e101ab21f0e38386c50216ad623b85833c3 Mon Sep 17 00:00:00 2001 From: F1F88 <0xf1f88@gmail.com> Date: Thu, 12 Dec 2024 19:34:59 +0800 Subject: [PATCH] Move enum class async_overflow_policy to backend_worker.h --- include/spdlog/async_logger.h | 8 -------- include/spdlog/details/backend_worker.h | 9 +++++++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/include/spdlog/async_logger.h b/include/spdlog/async_logger.h index 772555e3..7e26878d 100644 --- a/include/spdlog/async_logger.h +++ b/include/spdlog/async_logger.h @@ -19,14 +19,6 @@ namespace spdlog { -// Async overflow policy - block by default. -enum class async_overflow_policy { - block, // Block until message can be enqueued - overrun_oldest, // Discard oldest message in the queue if full when trying to - // add new item. - discard_new // Discard new message if the queue is full when trying to add new item. -}; - namespace details { class thread_pool; } diff --git a/include/spdlog/details/backend_worker.h b/include/spdlog/details/backend_worker.h index 1bfeef43..3affc3ae 100644 --- a/include/spdlog/details/backend_worker.h +++ b/include/spdlog/details/backend_worker.h @@ -3,11 +3,16 @@ #pragma once - namespace spdlog { +// Async overflow policy - block by default. +enum class async_overflow_policy { + block, // Block until message can be enqueued + overrun_oldest, // Discard oldest message in the queue if full when trying to + // add new item. + discard_new // Discard new message if the queue is full when trying to add new item. +}; namespace details { - class thread_pool; class backend_worker : public std::enable_shared_from_this {