Skip to content

Commit

Permalink
Logging consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev authored and clemahieu committed Jul 9, 2024
1 parent f5590e9 commit 1db6577
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion nano/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ nano::node::node (std::shared_ptr<boost::asio::io_context> 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 ());
Expand Down
18 changes: 9 additions & 9 deletions nano/node/repcrawler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void nano::rep_crawler::validate_and_process (nano::unique_lock<nano::mutex> & 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;
Expand Down Expand Up @@ -121,11 +121,11 @@ void nano::rep_crawler::validate_and_process (nano::unique_lock<nano::mutex> & 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 ());
}
}
}
Expand Down Expand Up @@ -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
}
Expand All @@ -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
Expand Down Expand Up @@ -350,7 +350,7 @@ void nano::rep_crawler::query (std::vector<std::shared_ptr<nano::transport::chan
bool tracked = track_rep_request (hash_root, channel);
if (tracked)
{
logger.debug (nano::log::type::rep_crawler, "Sending query for block {} to {}", hash_root.first.to_string (), channel->to_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;
Expand All @@ -368,7 +368,7 @@ void nano::rep_crawler::query (std::vector<std::shared_ptr<nano::transport::chan
}
else
{
logger.debug (nano::log::type::rep_crawler, "Ignoring duplicate query for block {} to {}", hash_root.first.to_string (), channel->to_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);
}
}
Expand Down Expand Up @@ -404,7 +404,7 @@ bool nano::rep_crawler::process (std::shared_ptr<nano::vote> 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
Expand Down

0 comments on commit 1db6577

Please sign in to comment.