Demote some stable logs to Debugw (#1158)

* Demote some stable logs to Debugw

* Add 'discard message from' to ignore list
This commit is contained in:
Raja Subramanian
2022-11-11 05:47:47 +01:00
committed by GitHub
parent e2d775588f
commit fe0502c886
5 changed files with 8 additions and 27 deletions

View File

@@ -17,6 +17,7 @@ var (
"pingAllCandidates called with no candidate pairs",
"failed to send packet",
"Ignoring remote candidate with tcpType active",
"discard message from",
},
"pc": {
"Failed to accept RTCP stream is already closed",

View File

@@ -766,20 +766,9 @@ func (p *ParticipantImpl) GetConnectionQuality() *livekit.ConnectionQualityInfo
avgScore = totalScore / float32(numTracks)
}
if avgScore < 4.5 {
p.params.Logger.Infow(
"low connection quality score",
"avgScore", avgScore,
"publisherScores", publisherScores,
"subscriberScores", subscriberScores,
)
}
rating := connectionquality.Score2Rating(avgScore)
return &livekit.ConnectionQualityInfo{
ParticipantSid: string(p.ID()),
Quality: rating,
Quality: connectionquality.Score2Rating(avgScore),
Score: avgScore,
}
}

View File

@@ -435,7 +435,7 @@ func (t *PCTransport) setConnectedAt(at time.Time) bool {
}
func (t *PCTransport) onICEGatheringStateChange(state webrtc.ICEGathererState) {
t.params.Logger.Infow("ice gathering state change", "state", state.String())
t.params.Logger.Debugw("ice gathering state change", "state", state.String())
if state != webrtc.ICEGathererStateComplete {
return
}
@@ -469,7 +469,7 @@ func (t *PCTransport) handleConnectionFailed() {
}
func (t *PCTransport) onICEConnectionStateChange(state webrtc.ICEConnectionState) {
t.params.Logger.Infow("ice connection state change", "state", state.String())
t.params.Logger.Debugw("ice connection state change", "state", state.String())
switch state {
case webrtc.ICEConnectionStateConnected:
t.setICEConnectedAt(time.Now())
@@ -482,7 +482,7 @@ func (t *PCTransport) onICEConnectionStateChange(state webrtc.ICEConnectionState
}
func (t *PCTransport) onPeerConnectionStateChange(state webrtc.PeerConnectionState) {
t.params.Logger.Infow("peer connection state change", "state", state.String())
t.params.Logger.Debugw("peer connection state change", "state", state.String())
switch state {
case webrtc.PeerConnectionStateConnected:
t.logICECandidates()
@@ -495,6 +495,7 @@ func (t *PCTransport) onPeerConnectionStateChange(state webrtc.PeerConnectionSta
t.maybeNotifyFullyEstablished()
}
case webrtc.PeerConnectionStateFailed:
t.params.Logger.Infow("peer connection failed")
t.logICECandidates()
t.handleConnectionFailed()
}

View File

@@ -239,7 +239,7 @@ func (u *UpTrackManager) UpdateSubscriptionPermission(
// store as is for use when migrating
u.subscriptionPermission = subscriptionPermission
if subscriptionPermission == nil {
u.params.Logger.Infow(
u.params.Logger.Debugw(
"updating subscription permission, setting to nil",
"version", u.subscriptionPermissionVersion.ToProto().String(),
)
@@ -248,7 +248,7 @@ func (u *UpTrackManager) UpdateSubscriptionPermission(
return nil
}
u.params.Logger.Infow(
u.params.Logger.Debugw(
"updating subscription permission",
"permissions", u.subscriptionPermission.String(),
"version", u.subscriptionPermissionVersion.ToProto().String(),

View File

@@ -39,7 +39,6 @@ type ConnectionStats struct {
lock sync.RWMutex
score float32
lastUpdate time.Time
isLowQuality atomic.Bool
maxExpectedLayer int32
done chan struct{}
@@ -244,15 +243,6 @@ func (cs *ConnectionStats) updateScore(streams map[uint32]*buffer.StreamStatsWit
}
}
if cs.score < 4.2 {
if !cs.isLowQuality.Swap(true) {
// changed from good to low quality, log
cs.params.Logger.Infow("low connection quality", "score", cs.score, "params", params)
}
} else {
cs.isLowQuality.Store(false)
}
return cs.score
}