From 4cb587b42421d52eb8b11b22161da0e2a8182dfb Mon Sep 17 00:00:00 2001 From: Mateus Sanches Moura <msanches@iri.upc.edu> Date: Mon, 17 Jun 2024 15:22:47 +0200 Subject: [PATCH] upgrade spdlog to newest version (>=v1.0) --- include/core/utils/logging.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/core/utils/logging.h b/include/core/utils/logging.h index df58dfd1f..9c94909e2 100644 --- a/include/core/utils/logging.h +++ b/include/core/utils/logging.h @@ -34,8 +34,10 @@ // spdlog include #include "spdlog/spdlog.h" +#include "spdlog/async.h" // enable the use of ostream operator<< -#include "spdlog/fmt/bundled/ostream.h" +#include "spdlog/fmt/ostr.h" +#include "spdlog/sinks/stdout_color_sinks.h" // Wolf includes #include "core/utils/singleton.h" @@ -125,7 +127,7 @@ inline Logger::Logger(const std::string& name) : // Enable asynchronous logging // Queue size must be a power of 2 - spdlog::set_async_mode(4096); + spdlog::init_thread_pool(4096, 1); if (log_name_ == __INTERNAL_WOLF_MAIN_LOGGER_NAME_) // Logging pattern is : @@ -154,7 +156,7 @@ inline Logger::Logger(std::string&& name) : // Enable asynchronous logging // Queue size must be a power of 2 - spdlog::set_async_mode(4096); + spdlog::init_thread_pool(4096, 1); if (log_name_ == __INTERNAL_WOLF_MAIN_LOGGER_NAME_) // Logging pattern is : @@ -209,8 +211,7 @@ void Logger::trace(Args&&... args) const inline bool Logger::set_async_queue(const std::size_t q_size) { bool p2 = q_size%2 == 0; - - if (p2) spdlog::set_async_mode(q_size); + if (p2) spdlog::init_thread_pool(q_size, 1); return q_size; } -- GitLab