From d60a4c7b50f696f182220dda5e298977eb4ff40c Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 3 May 2024 13:31:30 +0300 Subject: [PATCH] Don't remove existing logger from registry in set_default_logger --- src/details/registry.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/details/registry.cpp b/src/details/registry.cpp index 7480123a..4d76aba9 100644 --- a/src/details/registry.cpp +++ b/src/details/registry.cpp @@ -125,10 +125,6 @@ namespace spdlog { // default logger is stored in default_logger_ (for faster retrieval) and in the loggers_ map. void registry::set_default_logger(std::shared_ptr new_default_logger) { std::lock_guard lock(logger_map_mutex_); - // remove previous default logger from the map - if (default_logger_ != nullptr) { - loggers_.erase(default_logger_->name()); - } if (new_default_logger != nullptr) { loggers_[new_default_logger->name()] = new_default_logger; }