Compare commits

...

1 commit

Author SHA1 Message Date
Sandip Patel
eae95f1ea2 Adjust p2p log level 2019-10-15 11:54:15 +05:30
2 changed files with 12 additions and 12 deletions

View file

@ -1249,7 +1249,7 @@ namespace graphene { namespace net { namespace detail {
for (const peer_connection_ptr& peer : _active_connections) for (const peer_connection_ptr& peer : _active_connections)
{ {
// only advertise to peers who are in sync with us // only advertise to peers who are in sync with us
wdump((peer->peer_needs_sync_items_from_us)); idump((peer->peer_needs_sync_items_from_us));
if( !peer->peer_needs_sync_items_from_us ) if( !peer->peer_needs_sync_items_from_us )
{ {
std::map<uint32_t, std::vector<item_hash_t> > items_to_advertise_by_type; std::map<uint32_t, std::vector<item_hash_t> > items_to_advertise_by_type;
@ -1257,7 +1257,7 @@ namespace graphene { namespace net { namespace detail {
// or anything it has advertised to us // or anything it has advertised to us
// group the items we need to send by type, because we'll need to send one inventory message per type // group the items we need to send by type, because we'll need to send one inventory message per type
unsigned total_items_to_send_to_this_peer = 0; unsigned total_items_to_send_to_this_peer = 0;
wdump((inventory_to_advertise)); idump((inventory_to_advertise));
for (const item_id& item_to_advertise : inventory_to_advertise) for (const item_id& item_to_advertise : inventory_to_advertise)
{ {
auto adv_to_peer = peer->inventory_advertised_to_peer.find(item_to_advertise); auto adv_to_peer = peer->inventory_advertised_to_peer.find(item_to_advertise);
@ -1276,9 +1276,9 @@ namespace graphene { namespace net { namespace detail {
else else
{ {
if (adv_to_peer != peer->inventory_advertised_to_peer.end() ) if (adv_to_peer != peer->inventory_advertised_to_peer.end() )
wdump( (*adv_to_peer) ); idump( (*adv_to_peer) );
if (adv_to_us != peer->inventory_peer_advertised_to_us.end() ) if (adv_to_us != peer->inventory_peer_advertised_to_us.end() )
wdump( (*adv_to_us) ); idump( (*adv_to_us) );
} }
} }
dlog("advertising ${count} new item(s) of ${types} type(s) to peer ${endpoint}", dlog("advertising ${count} new item(s) of ${types} type(s) to peer ${endpoint}",
@ -2278,7 +2278,7 @@ namespace graphene { namespace net { namespace detail {
bool disconnect_from_inhibited_peer = false; bool disconnect_from_inhibited_peer = false;
// if our client doesn't have any items after the item the peer requested, it will send back // if our client doesn't have any items after the item the peer requested, it will send back
// a list containing the last item the peer requested // a list containing the last item the peer requested
wdump((reply_message)(fetch_blockchain_item_ids_message_received.blockchain_synopsis)); idump((reply_message)(fetch_blockchain_item_ids_message_received.blockchain_synopsis));
if( reply_message.item_hashes_available.empty() ) if( reply_message.item_hashes_available.empty() )
originating_peer->peer_needs_sync_items_from_us = false; /* I have no items in my blockchain */ originating_peer->peer_needs_sync_items_from_us = false; /* I have no items in my blockchain */
else if( !fetch_blockchain_item_ids_message_received.blockchain_synopsis.empty() && else if( !fetch_blockchain_item_ids_message_received.blockchain_synopsis.empty() &&
@ -2935,7 +2935,7 @@ namespace graphene { namespace net { namespace detail {
if( closing_connection_message_received.closing_due_to_error ) if( closing_connection_message_received.closing_due_to_error )
{ {
elog( "Peer ${peer} is disconnecting us because of an error: ${msg}, exception: ${error}", wlog( "Peer ${peer} is disconnecting us because of an error: ${msg}, exception: ${error}",
( "peer", originating_peer->get_remote_endpoint() ) ( "peer", originating_peer->get_remote_endpoint() )
( "msg", closing_connection_message_received.reason_for_closing ) ( "msg", closing_connection_message_received.reason_for_closing )
( "error", closing_connection_message_received.error ) ); ( "error", closing_connection_message_received.error ) );

View file

@ -260,7 +260,7 @@ namespace graphene { namespace net
} }
catch ( fc::exception& e ) catch ( fc::exception& e )
{ {
elog( "fatal: error connecting to peer ${remote_endpoint}: ${e}", ("remote_endpoint", remote_endpoint )("e", e.to_detail_string() ) ); wlog( "fatal: error connecting to peer ${remote_endpoint}: ${e}", ("remote_endpoint", remote_endpoint )("e", e.to_detail_string() ) );
throw; throw;
} }
} // connect_to() } // connect_to()
@ -312,24 +312,24 @@ namespace graphene { namespace net
} }
catch (const fc::exception& send_error) catch (const fc::exception& send_error)
{ {
elog("Error sending message: ${exception}. Closing connection.", ("exception", send_error)); wlog("Error sending message: ${exception}. Closing connection.", ("exception", send_error));
try try
{ {
close_connection(); close_connection();
} }
catch (const fc::exception& close_error) catch (const fc::exception& close_error)
{ {
elog("Caught error while closing connection: ${exception}", ("exception", close_error)); wlog("Caught error while closing connection: ${exception}", ("exception", close_error));
} }
return; return;
} }
catch (const std::exception& e) catch (const std::exception& e)
{ {
elog("message_oriented_exception::send_message() threw a std::exception(): ${what}", ("what", e.what())); wlog("message_oriented_exception::send_message() threw a std::exception(): ${what}", ("what", e.what()));
} }
catch (...) catch (...)
{ {
elog("message_oriented_exception::send_message() threw an unhandled exception"); wlog("message_oriented_exception::send_message() threw an unhandled exception");
} }
_queued_messages.front()->transmission_finish_time = fc::time_point::now(); _queued_messages.front()->transmission_finish_time = fc::time_point::now();
_total_queued_messages_size -= _queued_messages.front()->get_size_in_queue(); _total_queued_messages_size -= _queued_messages.front()->get_size_in_queue();
@ -345,7 +345,7 @@ namespace graphene { namespace net
_queued_messages.emplace(std::move(message_to_send)); _queued_messages.emplace(std::move(message_to_send));
if (_total_queued_messages_size > GRAPHENE_NET_MAXIMUM_QUEUED_MESSAGES_IN_BYTES) if (_total_queued_messages_size > GRAPHENE_NET_MAXIMUM_QUEUED_MESSAGES_IN_BYTES)
{ {
elog("send queue exceeded maximum size of ${max} bytes (current size ${current} bytes)", wlog("send queue exceeded maximum size of ${max} bytes (current size ${current} bytes)",
("max", GRAPHENE_NET_MAXIMUM_QUEUED_MESSAGES_IN_BYTES)("current", _total_queued_messages_size)); ("max", GRAPHENE_NET_MAXIMUM_QUEUED_MESSAGES_IN_BYTES)("current", _total_queued_messages_size));
try try
{ {