Skip to content

Commit

Permalink
SYSTEM CONNECT LOGGING
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Apr 17, 2024
1 parent 0d262d9 commit d1eaf71
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions nano/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,11 @@ nano::telemetry_data nano::node::local_telemetry () const
return telemetry_data;
}

std::string nano::node::identifier () const
{
return make_logger_identifier (node_id);
}

std::string nano::node::make_logger_identifier (const nano::keypair & node_id)
{
// Node identifier consists of first 10 characters of node id
Expand Down
1 change: 1 addition & 0 deletions nano/node/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class node final : public std::enable_shared_from_this<node>
void bootstrap_block (nano::block_hash const &);
nano::account get_node_id () const;
nano::telemetry_data local_telemetry () const;
std::string identifier () const;

public:
const nano::keypair node_id;
Expand Down
4 changes: 3 additions & 1 deletion nano/test_common/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ std::shared_ptr<nano::node> nano::test::system::add_node (nano::node_config cons
auto starting_keepalives_1 = node1->stats.count (stat::type::message, stat::detail::keepalive, stat::dir::in);
auto starting_keepalives_2 = node2->stats.count (stat::type::message, stat::detail::keepalive, stat::dir::in);

logger.debug (nano::log::type::system, "Connecting nodes: {} and {}", node1->identifier (), node2->identifier ());

// TCP is the only transport layer available.
debug_assert (type_a == nano::transport::transport_type::tcp);
(*j)->network.merge_peer ((*i)->network.endpoint ());
node1->network.merge_peer (node2->network.endpoint ());

{
auto ec = poll_until_true (5s, [&node1, &node2, starting_size_1, starting_size_2] () {
Expand Down

0 comments on commit d1eaf71

Please sign in to comment.