From f6a964d52e9e620dcb1a45eb0c5a7daf780c0512 Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 6 Dec 2024 15:16:43 +0200 Subject: [PATCH] Clean context --- include/spdlog/details/context.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/spdlog/details/context.h b/include/spdlog/details/context.h index 80b437f1..6059c7b5 100644 --- a/include/spdlog/details/context.h +++ b/include/spdlog/details/context.h @@ -29,26 +29,25 @@ public: context(const context &) = delete; context &operator=(const context &) = delete; - std::shared_ptr global_logger(); + [[nodiscard]] std::shared_ptr global_logger(); // Return raw ptr to the global logger. // To be used directly by the spdlog global api (e.g. spdlog::info) // This make the global API faster, but cannot be used concurrently with set_global_logger(). // e.g do not call set_global_logger() from one thread while calling spdlog::info() from // another. - logger *global_logger_raw() const noexcept; + [[nodiscard]] logger *global_logger_raw() const noexcept; // set logger instance. void set_logger(std::shared_ptr new_logger); void set_tp(std::shared_ptr tp); - std::shared_ptr get_tp(); + [[nodiscard]] std::shared_ptr get_tp(); // clean all resources void shutdown(); - std::recursive_mutex &tp_mutex(); - + [[nodiscard]] std::recursive_mutex &tp_mutex(); private: std::recursive_mutex tp_mutex_;