Skip to content

Commit d29b350

Browse files
Log the peer ID when logging operational IP lookup results. (#34381)
This allows correlating IP results with the peer ID we were resolving.
1 parent ce844bc commit d29b350

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib/address_resolve/AddressResolve_DefaultImpl.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,16 @@ void NodeLookupHandle::LookupResult(const ResolveResult & result)
4747
char addr_string[Transport::PeerAddress::kMaxToStringSize];
4848
result.address.ToString(addr_string);
4949

50+
const PeerId peerId = GetRequest().GetPeerId();
5051
if (success)
5152
{
52-
ChipLogProgress(Discovery, "%s: new best score: %u", addr_string, to_underlying(score));
53+
ChipLogProgress(Discovery, "%s: new best score: %u (for " ChipLogFormatPeerId ")", addr_string, to_underlying(score),
54+
ChipLogValuePeerId(peerId));
5355
}
5456
else
5557
{
56-
ChipLogProgress(Discovery, "%s: score has not improved: %u", addr_string, to_underlying(score));
58+
ChipLogProgress(Discovery, "%s: score has not improved: %u (for " ChipLogFormatPeerId ")", addr_string,
59+
to_underlying(score), ChipLogValuePeerId(peerId));
5760
}
5861
#endif
5962
}

0 commit comments

Comments
 (0)