diff --git a/include/spdlog/details/registry.h b/include/spdlog/details/registry.h index f6bfe0bd..e22b8bbc 100644 --- a/include/spdlog/details/registry.h +++ b/include/spdlog/details/registry.h @@ -49,6 +49,7 @@ public: void initialize_logger(std::shared_ptr new_logger) { + std::lock_guard lock(logger_map_mutex_); new_logger->set_formatter(formatter_->clone()); if (err_handler_) @@ -222,6 +223,7 @@ public: void set_automatic_registration(bool automatic_regsistration) { + std::lock_guard lock(logger_map_mutex_); automatic_registration_ = automatic_regsistration; }