From 581420b7685df6de1c531c10eee2f348f1404565 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Wed, 5 Apr 2017 15:23:13 -0700 Subject: [PATCH] tun2: only log failure chance if it's nonzero --- lib/tun2/server.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/tun2/server.go b/lib/tun2/server.go index 57ef639..f3cea7f 100644 --- a/lib/tun2/server.go +++ b/lib/tun2/server.go @@ -165,10 +165,12 @@ func (s *Server) ListenAndServe() error { for _, c := range s.conns { failureChance := c.detector.Phi(now) - ln.Log(c.F(), ln.F{ - "action": "phi_failure_detection", - "value": failureChance, - }) + if failureChance != 0 { + ln.Log(c.F(), ln.F{ + "action": "phi_failure_detection", + "value": failureChance, + }) + } } s.connlock.Unlock() }