Log cleanup pass (#2285)

* Log cleanup pass

Demoted a bunch of logs to DEBUG, consolidated logs.

* use context logger and fix context var usage

* moved common error types, fixed tests
This commit is contained in:
David Zhao
2023-12-02 15:07:31 -08:00
committed by GitHub
parent beecfe3710
commit 3fe124c87f
24 changed files with 1171 additions and 149 deletions
+4 -4
View File
@@ -111,7 +111,7 @@ func (u *UpTrackManager) SetPublishedTrackMuted(trackID livekit.TrackID, muted b
track.SetMuted(muted)
if currentMuted != track.IsMuted() {
u.params.Logger.Infow("publisher mute status changed", "trackID", trackID, "muted", track.IsMuted())
u.params.Logger.Debugw("publisher mute status changed", "trackID", trackID, "muted", track.IsMuted())
if u.onTrackUpdated != nil {
u.onTrackUpdated(track)
}
@@ -142,7 +142,7 @@ func (u *UpTrackManager) GetPublishedTracks() []types.MediaTrack {
func (u *UpTrackManager) UpdateSubscriptionPermission(
subscriptionPermission *livekit.SubscriptionPermission,
timedVersion utils.TimedVersion,
resolverByIdentity func(participantIdentity livekit.ParticipantIdentity) types.LocalParticipant,
_ func(participantIdentity livekit.ParticipantIdentity) types.LocalParticipant, // TODO: separate PR to remove this argument
resolverBySid func(participantID livekit.ParticipantID) types.LocalParticipant,
) error {
u.lock.Lock()
@@ -203,7 +203,7 @@ func (u *UpTrackManager) UpdateSubscriptionPermission(
}
u.lock.Unlock()
u.maybeRevokeSubscriptions(resolverByIdentity)
u.maybeRevokeSubscriptions()
return nil
}
@@ -381,7 +381,7 @@ func (u *UpTrackManager) getAllowedSubscribersLocked(trackID livekit.TrackID) []
return allowed
}
func (u *UpTrackManager) maybeRevokeSubscriptions(resolver func(participantIdentity livekit.ParticipantIdentity) types.LocalParticipant) {
func (u *UpTrackManager) maybeRevokeSubscriptions() {
u.lock.Lock()
defer u.lock.Unlock()