Skip to content

Commit

Permalink
Demote some logs to Debugw (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzhao authored Dec 2, 2023
1 parent b0a6c1e commit 363298f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
15 changes: 9 additions & 6 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ func (e *RTCEngine) configure(res *livekit.JoinResponse) error {
if pair, err := primaryTransport.GetSelectedCandidatePair(); err == nil {
fields = append(fields, "iceCandidatePair", pair)
}
logger.Infow("ICE connected", fields...)
logger.Debugw("ICE connected", fields...)
case webrtc.ICEConnectionStateDisconnected:
logger.Infow("ICE disconnected")
logger.Debugw("ICE disconnected")
case webrtc.ICEConnectionStateFailed:
logger.Infow("ICE failed")
logger.Debugw("ICE failed")
e.handleDisconnect(false)
}
})
Expand Down Expand Up @@ -299,7 +299,7 @@ func (e *RTCEngine) configure(res *livekit.JoinResponse) error {
if err := e.publisher.SetRemoteDescription(sd); err != nil {
logger.Errorw("could not set remote description", err)
} else {
logger.Infow("successfully set publisher answer")
logger.Debugw("successfully set publisher answer")
}
}
e.client.OnTrickle = func(init webrtc.ICECandidateInit, target livekit.SignalTarget) {
Expand All @@ -314,7 +314,7 @@ func (e *RTCEngine) configure(res *livekit.JoinResponse) error {
}
}
e.client.OnOffer = func(sd webrtc.SessionDescription) {
logger.Infow("received offer for subscriber")
logger.Debugw("received offer for subscriber")
if err := e.subscriber.SetRemoteDescription(sd); err != nil {
logger.Errorw("could not set remote description", err)
return
Expand Down Expand Up @@ -546,7 +546,10 @@ func (e *RTCEngine) handleLeave(leave *livekit.LeaveRequest) {
if leave.GetCanReconnect() {
e.handleDisconnect(true)
} else {
logger.Infow("Leave room", "reason", leave.GetReason())
logger.Infow("server initiated leave",
"reason", leave.GetReason(),
"canReconnect", leave.GetCanReconnect(),
)
if e.OnDisconnected != nil {
e.OnDisconnected()
}
Expand Down
6 changes: 3 additions & 3 deletions transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ func (t *PCTransport) onICEGatheringStateChange(state webrtc.ICEGathererState) {
t.lock.Lock()
if t.restartAfterGathering {
t.lock.Unlock()
logger.Infow("restarting ICE after ICE gathering")
logger.Debugw("restarting ICE after ICE gathering")
if err := t.createAndSendOffer(&webrtc.OfferOptions{ICERestart: true}); err != nil {
logger.Errorw("could not restart ICE", err)
}
} else if t.pendingRestartIceOffer != nil {
logger.Infow("accept remote restart ice offer after ICE gathering")
logger.Debugw("accept remote restart ice offer after ICE gathering")
offer := t.pendingRestartIceOffer
t.pendingRestartIceOffer = nil
t.lock.Unlock()
Expand Down Expand Up @@ -213,7 +213,7 @@ func (t *PCTransport) SetRemoteDescription(sd webrtc.SessionDescription) error {
}

if offerRestartICE && t.pc.ICEGatheringState() == webrtc.ICEGatheringStateGathering {
logger.Infow("remote offer restart ice while ice gathering")
logger.Debugw("remote offer restart ice while ice gathering")
t.pendingRestartIceOffer = &sd
t.lock.Unlock()
return nil
Expand Down

0 comments on commit 363298f

Please sign in to comment.