From 6519c7596a163bd1b176e328c535b9946814589b Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Wed, 28 Feb 2024 12:11:40 +0530 Subject: [PATCH] Demote some logs. (#2523) When a fallback is not applied, it is due to signal interruption. ICE connection failing happens. And every time there is error, it is due to "no selected pair". Move all of it to `Debugw`. `setting ICE config` is the definitive log which says if a different ICE config was applied. --- pkg/rtc/transport.go | 8 +------- pkg/rtc/transportmanager.go | 13 ++++++++----- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/pkg/rtc/transport.go b/pkg/rtc/transport.go index 22983adf..1765f865 100644 --- a/pkg/rtc/transport.go +++ b/pkg/rtc/transport.go @@ -603,14 +603,8 @@ func (t *PCTransport) handleConnectionFailed(forceShortConn bool) { isShort, duration = t.IsShortConnection(time.Now()) if isShort { pair, err := t.getSelectedPair() - if err != nil { - t.params.Logger.Warnw("short ICE connection", err, "duration", duration) - } else { - t.params.Logger.Infow("short ICE connection", "pair", pair, "duration", duration) - } + t.params.Logger.Debugw("short ICE connection", "error", err, "pair", pair, "duration", duration) } - } else { - t.params.Logger.Infow("force short ICE connection") } t.params.Handler.OnFailed(isShort) diff --git a/pkg/rtc/transportmanager.go b/pkg/rtc/transportmanager.go index 9dfbcce5..cd1b2328 100644 --- a/pkg/rtc/transportmanager.go +++ b/pkg/rtc/transportmanager.go @@ -523,8 +523,11 @@ func (t *TransportManager) handleConnectionFailed(isShortLived bool) { if !t.hasRecentSignalLocked() || !signalValid { // the failed might cause by network interrupt because signal closed or we have not seen any signal in the time window, // so don't switch to next candidate type - t.params.Logger.Infow("ignoring prefer candidate check by ICE failure because signal connection interrupted", - "lastSignalSince", lastSignalSince, "signalValid", signalValid) + t.params.Logger.Debugw( + "ignoring prefer candidate check by ICE failure because signal connection interrupted", + "lastSignalSince", lastSignalSince, + "signalValid", signalValid, + ) t.failureCount = 0 t.lastFailure = time.Time{} t.lock.Unlock() @@ -572,13 +575,13 @@ func (t *TransportManager) handleConnectionFailed(isShortLived bool) { switch preferNext { case livekit.ICECandidateType_ICT_TCP: - t.params.Logger.Infow("prefer TCP transport on both peer connections") + t.params.Logger.Debugw("prefer TCP transport on both peer connections") case livekit.ICECandidateType_ICT_TLS: - t.params.Logger.Infow("prefer TLS transport both peer connections") + t.params.Logger.Debugw("prefer TLS transport both peer connections") case livekit.ICECandidateType_ICT_NONE: - t.params.Logger.Infow("allowing all transports on both peer connections") + t.params.Logger.Debugw("allowing all transports on both peer connections") } // irrespective of which one fails, force prefer candidate on both as the other one might