From 1db6577f29a37d14286e17fcf35401416baf3972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Tue, 9 Jul 2024 13:50:05 +0200 Subject: [PATCH] Logging consistency --- nano/node/node.cpp | 2 +- nano/node/repcrawler.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nano/node/node.cpp b/nano/node/node.cpp index b0b41b3a67..eaa141884d 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -374,7 +374,7 @@ nano::node::node (std::shared_ptr io_ctx_a, std::filesy auto const network_label = network_params.network.get_current_network_as_string (); - logger.info (nano::log::type::node, "Node starting, version: {}", NANO_VERSION_STRING); + logger.info (nano::log::type::node, "Version: {}", NANO_VERSION_STRING); logger.info (nano::log::type::node, "Build information: {}", BUILD_INFO); logger.info (nano::log::type::node, "Active network: {}", network_label); logger.info (nano::log::type::node, "Database backend: {}", store.vendor_get ()); diff --git a/nano/node/repcrawler.cpp b/nano/node/repcrawler.cpp index f2e22f3575..f6cca66b5f 100644 --- a/nano/node/repcrawler.cpp +++ b/nano/node/repcrawler.cpp @@ -83,7 +83,7 @@ void nano::rep_crawler::validate_and_process (nano::unique_lock & l nano::uint128_t const rep_weight = node.ledger.weight (vote->account); if (rep_weight < minimum) { - logger.debug (nano::log::type::rep_crawler, "Ignoring vote from account {} with too little voting weight: {}", + logger.debug (nano::log::type::rep_crawler, "Ignoring vote from account: {} with too little voting weight: {}", vote->account.to_account (), nano::util::to_str (rep_weight)); continue; @@ -121,11 +121,11 @@ void nano::rep_crawler::validate_and_process (nano::unique_lock & l if (inserted) { - logger.info (nano::log::type::rep_crawler, "Found representative {} at {}", vote->account.to_account (), channel->to_string ()); + logger.info (nano::log::type::rep_crawler, "Found representative: {} at: {}", vote->account.to_account (), channel->to_string ()); } if (updated) { - logger.warn (nano::log::type::rep_crawler, "Updated representative {} at {} (was at: {})", vote->account.to_account (), channel->to_string (), prev_channel->to_string ()); + logger.warn (nano::log::type::rep_crawler, "Updated representative: {} at: {} (was at: {})", vote->account.to_account (), channel->to_string (), prev_channel->to_string ()); } } } @@ -202,7 +202,7 @@ void nano::rep_crawler::cleanup () erase_if (reps, [this] (rep_entry const & rep) { if (!rep.channel->alive ()) { - logger.info (nano::log::type::rep_crawler, "Evicting representative {} with dead channel at {}", rep.account.to_account (), rep.channel->to_string ()); + logger.info (nano::log::type::rep_crawler, "Evicting representative: {} with dead channel at: {}", rep.account.to_account (), rep.channel->to_string ()); stats.inc (nano::stat::type::rep_crawler, nano::stat::detail::channel_dead); return true; // Erase } @@ -215,12 +215,12 @@ void nano::rep_crawler::cleanup () { if (query.replies == 0) { - logger.debug (nano::log::type::rep_crawler, "Aborting unresponsive query for block {} from {}", query.hash.to_string (), query.channel->to_string ()); + logger.debug (nano::log::type::rep_crawler, "Aborting unresponsive query for block: {} from: {}", query.hash.to_string (), query.channel->to_string ()); stats.inc (nano::stat::type::rep_crawler, nano::stat::detail::query_timeout); } else { - logger.debug (nano::log::type::rep_crawler, "Completion of query with {} replies for block {} from {}", query.replies, query.hash.to_string (), query.channel->to_string ()); + logger.debug (nano::log::type::rep_crawler, "Completion of query with: {} replies for block: {} from: {}", query.replies, query.hash.to_string (), query.channel->to_string ()); stats.inc (nano::stat::type::rep_crawler, nano::stat::detail::query_completion); } return true; // Erase @@ -350,7 +350,7 @@ void nano::rep_crawler::query (std::vectorto_string ()); + logger.debug (nano::log::type::rep_crawler, "Sending query for block: {} to: {}", hash_root.first.to_string (), channel->to_string ()); stats.inc (nano::stat::type::rep_crawler, nano::stat::detail::query_sent); auto const & [hash, root] = hash_root; @@ -368,7 +368,7 @@ void nano::rep_crawler::query (std::vectorto_string ()); + logger.debug (nano::log::type::rep_crawler, "Ignoring duplicate query for block: {} to: {}", hash_root.first.to_string (), channel->to_string ()); stats.inc (nano::stat::type::rep_crawler, nano::stat::detail::query_duplicate); } } @@ -404,7 +404,7 @@ bool nano::rep_crawler::process (std::shared_ptr const & vote, std:: }); if (found) { - logger.debug (nano::log::type::rep_crawler, "Processing response for block {} from {}", target_hash.to_string (), channel->to_string ()); + logger.debug (nano::log::type::rep_crawler, "Processing response for block: {} from: {}", target_hash.to_string (), channel->to_string ()); stats.inc (nano::stat::type::rep_crawler, nano::stat::detail::response); // Track response time