From f8bb7e567768e166a2798a4ce1fd2d60fe018d10 Mon Sep 17 00:00:00 2001 From: "Bak, Jin Hyeong" Date: Fri, 5 Oct 2018 17:17:03 +0900 Subject: [PATCH] Fix #849, Can't build with SPDLOG_ENABLE_MESSAGE_COUNTER --- include/spdlog/details/logger_impl.h | 2 +- include/spdlog/logger.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/spdlog/details/logger_impl.h b/include/spdlog/details/logger_impl.h index 27f0eb46..e6700376 100644 --- a/include/spdlog/details/logger_impl.h +++ b/include/spdlog/details/logger_impl.h @@ -358,7 +358,7 @@ inline void spdlog::logger::default_err_handler_(const std::string &msg) fmt::print(stderr, "[*** LOG ERROR ***] [{}] [{}] {}\n", date_buf, name(), msg); } -inline void spdlog::logger::incr_msg_counter_(details::log_msg &msg) +inline void spdlog::logger::incr_msg_counter_(const details::log_msg &msg) { msg.msg_id = msg_counter_.fetch_add(1, std::memory_order_relaxed); } diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 13ef910f..59dc85d9 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -152,7 +152,7 @@ protected: void default_err_handler_(const std::string &msg); // increment the message count (only if defined(SPDLOG_ENABLE_MESSAGE_COUNTER)) - void incr_msg_counter_(details::log_msg &msg); + void incr_msg_counter_(const details::log_msg &msg); const std::string name_; std::vector sinks_;