From 0b7de3896f2a233ee7eced9b698c160032a9c30a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Sat, 13 Jan 2024 15:36:34 +0100 Subject: [PATCH] NO TAG IN GLOBAL LOGGING --- nano/lib/logging.hpp | 24 ++++++++++++------------ nano/nano_node/daemon.cpp | 6 +++--- nano/node/node.cpp | 6 +++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/nano/lib/logging.hpp b/nano/lib/logging.hpp index cc713c7288..cdb35259b5 100644 --- a/nano/lib/logging.hpp +++ b/nano/lib/logging.hpp @@ -120,38 +120,38 @@ nano::nlogger & default_logger (); namespace nano::log { template -void log (nano::log::level level, nano::log::type tag, spdlog::format_string_t fmt, Args &&... args) +void log (nano::log::level level, spdlog::format_string_t fmt, Args &&... args) { - nano::default_logger ().log (level, tag, fmt, std::forward (args)...); + nano::default_logger ().log (level, nano::log::type::all, fmt, std::forward (args)...); } template -void debug (nano::log::type tag, spdlog::format_string_t fmt, Args &&... args) +void debug (spdlog::format_string_t fmt, Args &&... args) { - nano::default_logger ().debug (tag, fmt, std::forward (args)...); + nano::default_logger ().debug (nano::log::type::all, fmt, std::forward (args)...); } template -void info (nano::log::type tag, spdlog::format_string_t fmt, Args &&... args) +void info (spdlog::format_string_t fmt, Args &&... args) { - nano::default_logger ().info (tag, fmt, std::forward (args)...); + nano::default_logger ().info (nano::log::type::all, fmt, std::forward (args)...); } template -void warn (nano::log::type tag, spdlog::format_string_t fmt, Args &&... args) +void warn (spdlog::format_string_t fmt, Args &&... args) { - nano::default_logger ().warn (tag, fmt, std::forward (args)...); + nano::default_logger ().warn (nano::log::type::all, fmt, std::forward (args)...); } template -void error (nano::log::type tag, spdlog::format_string_t fmt, Args &&... args) +void error (spdlog::format_string_t fmt, Args &&... args) { - nano::default_logger ().error (tag, fmt, std::forward (args)...); + nano::default_logger ().error (nano::log::type::all, fmt, std::forward (args)...); } template -void critical (nano::log::type tag, spdlog::format_string_t fmt, Args &&... args) +void critical (spdlog::format_string_t fmt, Args &&... args) { - nano::default_logger ().critical (tag, fmt, std::forward (args)...); + nano::default_logger ().critical (nano::log::type::all, fmt, std::forward (args)...); } } \ No newline at end of file diff --git a/nano/nano_node/daemon.cpp b/nano/nano_node/daemon.cpp index 0c90ec77da..2dfb19d8ec 100644 --- a/nano/nano_node/daemon.cpp +++ b/nano/nano_node/daemon.cpp @@ -63,7 +63,7 @@ constexpr std::size_t OPEN_FILE_DESCRIPTORS_LIMIT = 16384; void nano::daemon::run (std::filesystem::path const & data_path, nano::node_flags const & flags) { - nano::log::info (nano::log::type::daemon, "Daemon started"); + nano::log::info ("Daemon started"); install_abort_signal_handler (); @@ -77,7 +77,7 @@ void nano::daemon::run (std::filesystem::path const & data_path, nano::node_flag auto error = nano::read_log_config_toml (data_path, log_config, flags.config_overrides); if (error) { - nano::log::error (nano::log::type::daemon, "Error reading logging config: {}, using defaults", error.get_message ()); + nano::log::error ("Error reading logging config: {}, using defaults", error.get_message ()); log_config = nano::log_config::daemon_default (); } } @@ -243,5 +243,5 @@ void nano::daemon::run (std::filesystem::path const & data_path, nano::node_flag nlogger.critical (nano::log::type::daemon, "Error deserializing node config: {}", error.get_message ()); } - nano::log::info (nano::log::type::daemon, "Daemon exiting..."); + nano::log::info ("Daemon exiting..."); } diff --git a/nano/node/node.cpp b/nano/node/node.cpp index 6b4893f10a..c561e22c41 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -1498,7 +1498,7 @@ nano::node_wrapper::node_wrapper (std::filesystem::path const & path_a, std::fil auto error = nano::read_log_config_toml (config_path_a, log_config, node_flags_a.config_overrides); if (error) { - nano::log::error (nano::log::type::daemon, "Error reading logging config: {}, using defaults", error.get_message ()); + nano::log::error ("Error reading logging config: {}, using defaults", error.get_message ()); log_config = nano::log_config::daemon_default (); } } @@ -1510,11 +1510,11 @@ nano::node_wrapper::node_wrapper (std::filesystem::path const & path_a, std::fil { if (node_flags_a.config_overrides.empty ()) { - nano::log::error (nano::log::type::node_wrapper, "Error deserializing node config: {}", error.get_message ()); + nano::log::error ("Error deserializing node config: {}", error.get_message ()); } else { - nano::log::error (nano::log::type::node_wrapper, "Error deserializing node config or --config option: {}", error.get_message ()); + nano::log::error ("Error deserializing node config or --config option: {}", error.get_message ()); } std::exit (1); }