diff --git a/include/spdlog/details/logger_impl.h b/include/spdlog/details/logger_impl.h index 46301ea1..c4aeaf5d 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 1bcf4bc2..8f063032 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_;