diff --git a/nano/lib/logging.cpp b/nano/lib/logging.cpp index c1d4e098b5..8c5d2cd55f 100644 --- a/nano/lib/logging.cpp +++ b/nano/lib/logging.cpp @@ -211,7 +211,7 @@ spdlog::logger & nano::logger::get_logger (nano::log::type type, nano::log::deta { std::shared_lock lock{ mutex }; - if (auto it = spd_loggers.find (type); it != spd_loggers.end ()) + if (auto it = spd_loggers.find (std::make_pair (type, detail)); it != spd_loggers.end ()) { return *it->second; } diff --git a/nano/lib/logging.hpp b/nano/lib/logging.hpp index fb18a801cf..0b719db1f0 100644 --- a/nano/lib/logging.hpp +++ b/nano/lib/logging.hpp @@ -34,6 +34,8 @@ logger_id parse_logger_id (std::string const &); namespace nano { +using logger_id_t = std::pair; + class log_config final { public: @@ -90,7 +92,7 @@ class logger final logger (logger const &) = delete; public: - static void initialize (nano::log_config fallback, std::optional data_path = std::nullopt, std::vector const & config_overrides = std::vector ()); + static void initialize (nano::log_config fallback, std::optional data_path = std::nullopt, std::vector const & config_overrides = {}); static void initialize_for_tests (nano::log_config fallback); static void flush ();