peer close simplified logging.

This commit is contained in:
Miroslav Šedivý 2021-09-02 21:58:00 +02:00
parent c85d00e507
commit 75c1dd6d22
2 changed files with 4 additions and 10 deletions

View File

@ -74,11 +74,8 @@ func (peer *WebRTCPeerCtx) Destroy() {
// TODO: Send webrtc disconnect event via websocket. // TODO: Send webrtc disconnect event via websocket.
if err := peer.connection.Close(); err != nil { err := peer.connection.Close()
peer.logger.Warn().Err(err).Msg("peer connection destroyed with an error") peer.logger.Err(err).Msg("peer connection destroyed")
} else {
peer.logger.Info().Msg("peer connection destroyed")
}
peer.connection = nil peer.connection = nil
} }

View File

@ -80,11 +80,8 @@ func (peer *WebSocketPeerCtx) Destroy(reason string) {
Message: reason, Message: reason,
}) })
if err := peer.connection.Close(); err != nil { err := peer.connection.Close()
peer.logger.Warn().Err(err).Msg("peer connection destroyed with an error") peer.logger.Err(err).Msg("peer connection destroyed")
} else {
peer.logger.Info().Msg("peer connection destroyed")
}
peer.connection = nil peer.connection = nil
} }