From f80309068a830496a6f633124e426088b27ab345 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 17 Jul 2024 18:03:28 -0400 Subject: [PATCH] Log the peer ID when logging operational IP lookup results. This allows correlating IP results with the peer ID we were resolving. --- src/lib/address_resolve/AddressResolve_DefaultImpl.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/address_resolve/AddressResolve_DefaultImpl.cpp b/src/lib/address_resolve/AddressResolve_DefaultImpl.cpp index e10146f4669793..9888c96e721265 100644 --- a/src/lib/address_resolve/AddressResolve_DefaultImpl.cpp +++ b/src/lib/address_resolve/AddressResolve_DefaultImpl.cpp @@ -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 }