From 70cb7566e6ca74bcdedf9ab491025e120275b584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Tue, 23 Jan 2024 00:59:26 +0100 Subject: [PATCH] FIX LOGGER LOOKUP --- nano/lib/logging.cpp | 2 +- nano/lib/logging.hpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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 ();