clean up proto logging (#2221)
This commit is contained in:
@@ -40,7 +40,7 @@ func (s *StaticClientConfigurationManager) GetConfiguration(clientInfo *livekit.
|
|||||||
for _, c := range s.confs {
|
for _, c := range s.confs {
|
||||||
matched, err := c.Match.Match(clientInfo)
|
matched, err := c.Match.Match(clientInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Errorw("matchrule failed", err, "clientInfo", clientInfo.String())
|
logger.Errorw("matchrule failed", err, "clientInfo", logger.Proto(clientInfo))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if !matched {
|
if !matched {
|
||||||
|
|||||||
@@ -714,7 +714,7 @@ func (p *ParticipantImpl) SetMigrateInfo(
|
|||||||
p.supervisor.SetPublicationMute(livekit.TrackID(ti.Sid), ti.Muted)
|
p.supervisor.SetPublicationMute(livekit.TrackID(ti.Sid), ti.Muted)
|
||||||
|
|
||||||
p.pendingTracks[t.GetCid()] = &pendingTrackInfo{trackInfos: []*livekit.TrackInfo{ti}, migrated: true}
|
p.pendingTracks[t.GetCid()] = &pendingTrackInfo{trackInfos: []*livekit.TrackInfo{ti}, migrated: true}
|
||||||
p.pubLogger.Infow("pending track added (migration)", "trackID", ti.Sid, "track", ti.String())
|
p.pubLogger.Infow("pending track added (migration)", "trackID", ti.Sid, "track", logger.Proto(ti))
|
||||||
}
|
}
|
||||||
p.pendingTracksLock.Unlock()
|
p.pendingTracksLock.Unlock()
|
||||||
|
|
||||||
@@ -738,7 +738,7 @@ func (p *ParticipantImpl) Close(sendLeave bool, reason types.ParticipantCloseRea
|
|||||||
"sendLeave", sendLeave,
|
"sendLeave", sendLeave,
|
||||||
"reason", reason.String(),
|
"reason", reason.String(),
|
||||||
"isExpectedToResume", isExpectedToResume,
|
"isExpectedToResume", isExpectedToResume,
|
||||||
"clientInfo", p.params.ClientInfo.String(),
|
"clientInfo", logger.Proto(p.params.ClientInfo),
|
||||||
)
|
)
|
||||||
p.clearDisconnectTimer()
|
p.clearDisconnectTimer()
|
||||||
p.clearMigrationTimer()
|
p.clearMigrationTimer()
|
||||||
@@ -1659,12 +1659,12 @@ func (p *ParticipantImpl) addPendingTrackLocked(req *livekit.AddTrackRequest) *l
|
|||||||
} else {
|
} else {
|
||||||
p.pendingTracks[req.Cid].trackInfos = append(p.pendingTracks[req.Cid].trackInfos, ti)
|
p.pendingTracks[req.Cid].trackInfos = append(p.pendingTracks[req.Cid].trackInfos, ti)
|
||||||
}
|
}
|
||||||
p.pubLogger.Infow("pending track queued", "trackID", ti.Sid, "track", ti.String(), "request", req.String())
|
p.pubLogger.Infow("pending track queued", "trackID", ti.Sid, "track", logger.Proto(ti), "request", logger.Proto(req))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
p.pendingTracks[req.Cid] = &pendingTrackInfo{trackInfos: []*livekit.TrackInfo{ti}}
|
p.pendingTracks[req.Cid] = &pendingTrackInfo{trackInfos: []*livekit.TrackInfo{ti}}
|
||||||
p.pubLogger.Infow("pending track added", "trackID", ti.Sid, "track", ti.String(), "request", req.String())
|
p.pubLogger.Infow("pending track added", "trackID", ti.Sid, "track", logger.Proto(ti), "request", logger.Proto(req))
|
||||||
return ti
|
return ti
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1682,7 +1682,7 @@ func (p *ParticipantImpl) GetPendingTrack(trackID livekit.TrackID) *livekit.Trac
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *ParticipantImpl) sendTrackPublished(cid string, ti *livekit.TrackInfo) {
|
func (p *ParticipantImpl) sendTrackPublished(cid string, ti *livekit.TrackInfo) {
|
||||||
p.pubLogger.Debugw("sending track published", "cid", cid, "trackInfo", ti.String())
|
p.pubLogger.Debugw("sending track published", "cid", cid, "trackInfo", logger.Proto(ti))
|
||||||
_ = p.writeMessage(&livekit.SignalResponse{
|
_ = p.writeMessage(&livekit.SignalResponse{
|
||||||
Message: &livekit.SignalResponse_TrackPublished{
|
Message: &livekit.SignalResponse_TrackPublished{
|
||||||
TrackPublished: &livekit.TrackPublishedResponse{
|
TrackPublished: &livekit.TrackPublishedResponse{
|
||||||
@@ -1794,7 +1794,7 @@ func (p *ParticipantImpl) mediaTrackReceived(track *webrtc.TrackRemote, rtpRecei
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *ParticipantImpl) addMigrateMutedTrack(cid string, ti *livekit.TrackInfo) *MediaTrack {
|
func (p *ParticipantImpl) addMigrateMutedTrack(cid string, ti *livekit.TrackInfo) *MediaTrack {
|
||||||
p.pubLogger.Infow("add migrate muted track", "cid", cid, "trackID", ti.Sid, "track", ti.String())
|
p.pubLogger.Infow("add migrate muted track", "cid", cid, "trackID", ti.Sid, "track", logger.Proto(ti))
|
||||||
rtpReceiver := p.TransportManager.GetPublisherRTPReceiver(ti.Mid)
|
rtpReceiver := p.TransportManager.GetPublisherRTPReceiver(ti.Mid)
|
||||||
if rtpReceiver == nil {
|
if rtpReceiver == nil {
|
||||||
p.pubLogger.Errorw("could not find receiver for migrated track", nil, "trackID", ti.Sid)
|
p.pubLogger.Errorw("could not find receiver for migrated track", nil, "trackID", ti.Sid)
|
||||||
|
|||||||
@@ -160,8 +160,8 @@ func (u *UpTrackManager) UpdateSubscriptionPermission(
|
|||||||
u.params.Logger.Debugw(
|
u.params.Logger.Debugw(
|
||||||
"skipping older subscription permission version",
|
"skipping older subscription permission version",
|
||||||
"existingValue", perms,
|
"existingValue", perms,
|
||||||
"existingVersion", u.subscriptionPermissionVersion.ToProto().String(),
|
"existingVersion", u.subscriptionPermissionVersion.String(),
|
||||||
"requestingValue", subscriptionPermission.String(),
|
"requestingValue", logger.Proto(subscriptionPermission),
|
||||||
"requestingVersion", timedVersion.String(),
|
"requestingVersion", timedVersion.String(),
|
||||||
)
|
)
|
||||||
u.lock.Unlock()
|
u.lock.Unlock()
|
||||||
@@ -178,7 +178,7 @@ func (u *UpTrackManager) UpdateSubscriptionPermission(
|
|||||||
if subscriptionPermission == nil {
|
if subscriptionPermission == nil {
|
||||||
u.params.Logger.Debugw(
|
u.params.Logger.Debugw(
|
||||||
"updating subscription permission, setting to nil",
|
"updating subscription permission, setting to nil",
|
||||||
"version", u.subscriptionPermissionVersion.ToProto().String(),
|
"version", u.subscriptionPermissionVersion.String(),
|
||||||
)
|
)
|
||||||
// possible to get a nil when migrating
|
// possible to get a nil when migrating
|
||||||
u.lock.Unlock()
|
u.lock.Unlock()
|
||||||
@@ -187,8 +187,8 @@ func (u *UpTrackManager) UpdateSubscriptionPermission(
|
|||||||
|
|
||||||
u.params.Logger.Debugw(
|
u.params.Logger.Debugw(
|
||||||
"updating subscription permission",
|
"updating subscription permission",
|
||||||
"permissions", u.subscriptionPermission.String(),
|
"permissions", logger.Proto(u.subscriptionPermission),
|
||||||
"version", u.subscriptionPermissionVersion.ToProto().String(),
|
"version", u.subscriptionPermissionVersion.String(),
|
||||||
)
|
)
|
||||||
if err := u.parseSubscriptionPermissionsLocked(subscriptionPermission, func(pID livekit.ParticipantID) types.LocalParticipant {
|
if err := u.parseSubscriptionPermissionsLocked(subscriptionPermission, func(pID livekit.ParticipantID) types.LocalParticipant {
|
||||||
u.lock.Unlock()
|
u.lock.Unlock()
|
||||||
@@ -247,7 +247,7 @@ func (u *UpTrackManager) AddPublishedTrack(track types.MediaTrack) {
|
|||||||
u.publishedTracks[track.ID()] = track
|
u.publishedTracks[track.ID()] = track
|
||||||
}
|
}
|
||||||
u.lock.Unlock()
|
u.lock.Unlock()
|
||||||
u.params.Logger.Debugw("added published track", "trackID", track.ID(), "trackInfo", track.ToProto().String())
|
u.params.Logger.Debugw("added published track", "trackID", track.ID(), "trackInfo", logger.Proto(track.ToProto()))
|
||||||
|
|
||||||
track.AddOnClose(func() {
|
track.AddOnClose(func() {
|
||||||
notifyClose := false
|
notifyClose := false
|
||||||
|
|||||||
Reference in New Issue
Block a user