tun2: only log failure chance if it's nonzero

This commit is contained in:
Cadey Ratio 2017-04-05 15:23:13 -07:00
parent b1161e35f4
commit 581420b768
1 changed files with 6 additions and 4 deletions

View File

@ -165,10 +165,12 @@ func (s *Server) ListenAndServe() error {
for _, c := range s.conns { for _, c := range s.conns {
failureChance := c.detector.Phi(now) failureChance := c.detector.Phi(now)
ln.Log(c.F(), ln.F{ if failureChance != 0 {
"action": "phi_failure_detection", ln.Log(c.F(), ln.F{
"value": failureChance, "action": "phi_failure_detection",
}) "value": failureChance,
})
}
} }
s.connlock.Unlock() s.connlock.Unlock()
} }