Skip to content

Commit

Permalink
FIX LOGGER LOOKUP
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Jan 23, 2024
1 parent 77d8d98 commit 70cb756
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nano/lib/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 3 additions & 1 deletion nano/lib/logging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ logger_id parse_logger_id (std::string const &);

namespace nano
{
using logger_id_t = std::pair<nano::log::type, nano::log::detail>;

class log_config final
{
public:
Expand Down Expand Up @@ -90,7 +92,7 @@ class logger final
logger (logger const &) = delete;

public:
static void initialize (nano::log_config fallback, std::optional<std::filesystem::path> data_path = std::nullopt, std::vector<std::string> const & config_overrides = std::vector<std::string> ());
static void initialize (nano::log_config fallback, std::optional<std::filesystem::path> data_path = std::nullopt, std::vector<std::string> const & config_overrides = {});
static void initialize_for_tests (nano::log_config fallback);
static void flush ();

Expand Down

0 comments on commit 70cb756

Please sign in to comment.