diff --git a/include/spdlog/details/logger_impl.h b/include/spdlog/details/logger_impl.h index a29f7ad7..e7385b5d 100644 --- a/include/spdlog/details/logger_impl.h +++ b/include/spdlog/details/logger_impl.h @@ -293,7 +293,7 @@ inline void spdlog::logger::set_error_handler(spdlog::log_err_handler err_handle err_handler_ = std::move(err_handler); } -inline spdlog::log_err_handler spdlog::logger::error_handler() +inline spdlog::log_err_handler spdlog::logger::error_handler() const { return err_handler_; } diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 1e5db22b..4e08076b 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -140,7 +140,7 @@ public: // error handler void set_error_handler(log_err_handler err_handler); - log_err_handler error_handler(); + log_err_handler error_handler() const; // create new logger with same sinks and configuration. virtual std::shared_ptr clone(std::string logger_name);