Skip to content

Commit

Permalink
Uniform rep crawler log enum naming
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Feb 24, 2024
1 parent 4454e02 commit 3cf9460
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion nano/lib/logging_enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ enum class type
epoch_upgrader,
opencl_work,
upnp,
repcrawler,
rep_crawler,
lmdb,
rocksdb,
txn_tracker,
Expand Down
18 changes: 9 additions & 9 deletions nano/node/repcrawler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ void nano::rep_crawler::validate_and_process (nano::unique_lock<nano::mutex> & l

if (channel->get_type () == nano::transport::transport_type::loopback)
{
logger.debug (nano::log::type::repcrawler, "Ignoring vote from loopback channel: {}", channel->to_string ());
logger.debug (nano::log::type::rep_crawler, "Ignoring vote from loopback channel: {}", channel->to_string ());
continue;
}

nano::uint128_t const rep_weight = node.ledger.weight (vote->account);
if (rep_weight < minimum)
{
logger.debug (nano::log::type::repcrawler, "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 @@ -118,11 +118,11 @@ void nano::rep_crawler::validate_and_process (nano::unique_lock<nano::mutex> & l

if (inserted)
{
logger.info (nano::log::type::repcrawler, "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::repcrawler, "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 @@ -200,7 +200,7 @@ void nano::rep_crawler::cleanup ()
erase_if (reps, [this] (rep_entry const & rep) {
if (!rep.channel->alive ())
{
logger.debug (nano::log::type::repcrawler, "Evicting representative {} with dead channel at {}", rep.account.to_account (), rep.channel->to_string ());
logger.debug (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 @@ -211,7 +211,7 @@ void nano::rep_crawler::cleanup ()
erase_if (reps, [this] (rep_entry const & rep) {
if (nano::elapsed (rep.last_response, config.rep_timeout))
{
logger.debug (nano::log::type::repcrawler, "Evicting unresponsive representative {} at {}", rep.account.to_account (), rep.channel->to_string ());
logger.debug (nano::log::type::rep_crawler, "Evicting unresponsive representative {} at {}", rep.account.to_account (), rep.channel->to_string ());
stats.inc (nano::stat::type::rep_crawler, nano::stat::detail::rep_timeout);
return true; // Erase
}
Expand All @@ -222,7 +222,7 @@ void nano::rep_crawler::cleanup ()
erase_if (queries, [this] (query_entry const & query) {
if (nano::elapsed (query.time, config.query_timeout))
{
logger.debug (nano::log::type::repcrawler, "Evicting unresponsive query for block {} from {}", query.hash.to_string (), query.channel->to_string ());
logger.debug (nano::log::type::rep_crawler, "Evicting 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);
return true; // Erase
}
Expand Down Expand Up @@ -331,7 +331,7 @@ void nano::rep_crawler::query (std::vector<std::shared_ptr<nano::transport::chan
track_rep_request (hash_root, channel);
node.network.send_confirm_req (channel, hash_root);

logger.debug (nano::log::type::repcrawler, "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);
}
else
Expand Down Expand Up @@ -370,7 +370,7 @@ bool nano::rep_crawler::process (std::shared_ptr<nano::vote> const & vote, std::

if (found)
{
logger.debug (nano::log::type::repcrawler, "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);
// TODO: Track query response time

Expand Down

0 comments on commit 3cf9460

Please sign in to comment.