From 3f4373eb98bd6508a238f7fd3737f65a53fb3903 Mon Sep 17 00:00:00 2001 From: pierre Date: Wed, 26 Oct 2022 12:29:01 +0200 Subject: [PATCH] feat(explorer-api): add debug logs --- explorer-api/src/geo_ip/location.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/explorer-api/src/geo_ip/location.rs b/explorer-api/src/geo_ip/location.rs index ba75d4e52c..a1afec55d6 100644 --- a/explorer-api/src/geo_ip/location.rs +++ b/explorer-api/src/geo_ip/location.rs @@ -59,7 +59,7 @@ impl GeoIp { pub fn query(&self, address: &str, port: Option) -> Result, GeoIpError> { let ip: IpAddr = FromStr::from_str(address).or_else(|_| { - warn!( + debug!( "Fail to create IpAddr from {}. Trying using internal lookup...", &address ); @@ -75,7 +75,9 @@ impl GeoIp { error!("Fail to resolve IP address from {}:{}", &address, p); GeoIpError::NoValidIP })?; - Ok(socket_addr.ip()) + let ip = socket_addr.ip(); + debug!("Internal lookup succeed, resolved ip: {}", ip); + Ok(ip) })?; let result = self .db