Remove pessimistic String calls for low level logs

This commit is contained in:
Paul Wells
2024-04-30 23:59:23 -07:00
parent 78a9ef9c57
commit b5f4ca01ae
2 changed files with 6 additions and 7 deletions
+5 -6
View File
@@ -59,7 +59,7 @@ func (s *controllingSelector) ContactCandidates() {
default:
p := s.agent.getBestValidCandidatePair()
if p != nil && s.isNominatable(p.Local) && s.isNominatable(p.Remote) {
s.log.Tracef("Nominatable pair found, nominating (%s, %s)", p.Local.String(), p.Remote.String())
s.log.Tracef("Nominatable pair found, nominating (%s, %s)", p.Local, p.Remote)
p.nominated = true
s.nominatedPair = p
s.nominatePair(p)
@@ -87,7 +87,7 @@ func (s *controllingSelector) nominatePair(pair *CandidatePair) {
return
}
s.log.Tracef("Ping STUN (nominate candidate pair) from %s to %s", pair.Local.String(), pair.Remote.String())
s.log.Tracef("Ping STUN (nominate candidate pair) from %s to %s", pair.Local, pair.Remote)
s.agent.sendBindingRequest(msg, pair.Local, pair.Remote)
}
@@ -106,8 +106,7 @@ func (s *controllingSelector) HandleBindingRequest(m *stun.Message, local, remot
if bestPair == nil {
s.log.Tracef("No best pair available")
} else if bestPair.equal(p) && s.isNominatable(p.Local) && s.isNominatable(p.Remote) {
s.log.Tracef("The candidate (%s, %s) is the best candidate available, marking it as nominated",
p.Local.String(), p.Remote.String())
s.log.Tracef("The candidate (%s, %s) is the best candidate available, marking it as nominated", p.Local, p.Remote)
s.nominatedPair = p
s.nominatePair(p)
}
@@ -130,7 +129,7 @@ func (s *controllingSelector) HandleSuccessResponse(m *stun.Message, local, remo
return
}
s.log.Tracef("Inbound STUN (SuccessResponse) from %s to %s", remote.String(), local.String())
s.log.Tracef("Inbound STUN (SuccessResponse) from %s to %s", remote, local)
p := s.agent.findPair(local, remote)
if p == nil {
@@ -221,7 +220,7 @@ func (s *controlledSelector) HandleSuccessResponse(m *stun.Message, local, remot
return
}
s.log.Tracef("Inbound STUN (SuccessResponse) from %s to %s", remote.String(), local.String())
s.log.Tracef("Inbound STUN (SuccessResponse) from %s to %s", remote, local)
p := s.agent.findPair(local, remote)
if p == nil {
+1 -1
View File
@@ -343,7 +343,7 @@ func (m *UDPMuxDefault) connWorker() {
}
if destinationConn == nil {
m.params.Logger.Tracef("Dropping packet from %s, addr: %s", udpAddr.addr.String(), addr.String())
m.params.Logger.Tracef("Dropping packet from %s, addr: %s", udpAddr.addr, addr)
continue
}