Skip to content

Commit

Permalink
NO TAG IN GLOBAL LOGGING
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Jan 13, 2024
1 parent ffe89f4 commit 0b7de38
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
24 changes: 12 additions & 12 deletions nano/lib/logging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,38 +120,38 @@ nano::nlogger & default_logger ();
namespace nano::log
{
template <class... Args>
void log (nano::log::level level, nano::log::type tag, spdlog::format_string_t<Args...> fmt, Args &&... args)
void log (nano::log::level level, spdlog::format_string_t<Args...> fmt, Args &&... args)
{
nano::default_logger ().log (level, tag, fmt, std::forward<Args> (args)...);
nano::default_logger ().log (level, nano::log::type::all, fmt, std::forward<Args> (args)...);
}

template <class... Args>
void debug (nano::log::type tag, spdlog::format_string_t<Args...> fmt, Args &&... args)
void debug (spdlog::format_string_t<Args...> fmt, Args &&... args)
{
nano::default_logger ().debug (tag, fmt, std::forward<Args> (args)...);
nano::default_logger ().debug (nano::log::type::all, fmt, std::forward<Args> (args)...);
}

template <class... Args>
void info (nano::log::type tag, spdlog::format_string_t<Args...> fmt, Args &&... args)
void info (spdlog::format_string_t<Args...> fmt, Args &&... args)
{
nano::default_logger ().info (tag, fmt, std::forward<Args> (args)...);
nano::default_logger ().info (nano::log::type::all, fmt, std::forward<Args> (args)...);
}

template <class... Args>
void warn (nano::log::type tag, spdlog::format_string_t<Args...> fmt, Args &&... args)
void warn (spdlog::format_string_t<Args...> fmt, Args &&... args)
{
nano::default_logger ().warn (tag, fmt, std::forward<Args> (args)...);
nano::default_logger ().warn (nano::log::type::all, fmt, std::forward<Args> (args)...);
}

template <class... Args>
void error (nano::log::type tag, spdlog::format_string_t<Args...> fmt, Args &&... args)
void error (spdlog::format_string_t<Args...> fmt, Args &&... args)
{
nano::default_logger ().error (tag, fmt, std::forward<Args> (args)...);
nano::default_logger ().error (nano::log::type::all, fmt, std::forward<Args> (args)...);
}

template <class... Args>
void critical (nano::log::type tag, spdlog::format_string_t<Args...> fmt, Args &&... args)
void critical (spdlog::format_string_t<Args...> fmt, Args &&... args)
{
nano::default_logger ().critical (tag, fmt, std::forward<Args> (args)...);
nano::default_logger ().critical (nano::log::type::all, fmt, std::forward<Args> (args)...);
}
}
6 changes: 3 additions & 3 deletions nano/nano_node/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();

Expand All @@ -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 ();
}
}
Expand Down Expand Up @@ -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...");
}
6 changes: 3 additions & 3 deletions nano/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();
}
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 0b7de38

Please sign in to comment.