aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/stun_actor.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/stun_actor.rs b/src/stun_actor.rs
index 4cca4f1..bf4da73 100644
--- a/src/stun_actor.rs
+++ b/src/stun_actor.rs
@@ -120,6 +120,16 @@ impl StunAutodiscovery {
address: discovered_addr,
};
+ let msg = format!(
+ "STUN autodiscovery result: {} -> {:?}",
+ self.consul_key, discovered_addr
+ );
+ if self.last_result.as_ref().and_then(|x| x.address) != discovered_addr {
+ info!("{}", msg);
+ } else {
+ debug!("{}", msg);
+ }
+
consul
.kv_put(&self.consul_key, serde_json::to_vec(&current_result)?)
.await?;