Skip to content

Commit

Permalink
Log the peer ID when logging operational IP lookup results.
Browse files Browse the repository at this point in the history
This allows correlating IP results with the peer ID we were resolving.
  • Loading branch information
bzbarsky-apple committed Jul 17, 2024
1 parent 147f98b commit f803090
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib/address_resolve/AddressResolve_DefaultImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,16 @@ void NodeLookupHandle::LookupResult(const ResolveResult & result)
char addr_string[Transport::PeerAddress::kMaxToStringSize];
result.address.ToString(addr_string);

const PeerId peerId = GetRequest().GetPeerId();
if (success)
{
ChipLogProgress(Discovery, "%s: new best score: %u", addr_string, to_underlying(score));
ChipLogProgress(Discovery, "%s: new best score: %u (for " ChipLogFormatPeerId ")", addr_string, to_underlying(score),
ChipLogValuePeerId(peerId));
}
else
{
ChipLogProgress(Discovery, "%s: score has not improved: %u", addr_string, to_underlying(score));
ChipLogProgress(Discovery, "%s: score has not improved: %u (for " ChipLogFormatPeerId ")", addr_string,
to_underlying(score), ChipLogValuePeerId(peerId));
}
#endif
}
Expand Down

0 comments on commit f803090

Please sign in to comment.