From 52f8b7462cd48b957931f3e3d312065773933039 Mon Sep 17 00:00:00 2001 From: Jan Lelis Date: Tue, 19 May 2020 13:43:31 +0200 Subject: [PATCH] Log connection status events --- src/logger.js | 4 ++-- src/views/Room.vue | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/logger.js b/src/logger.js index bbc8bfd..54583f0 100644 --- a/src/logger.js +++ b/src/logger.js @@ -8,10 +8,10 @@ export default { }, warn(...args) { - console.log('WARNING', ...args) + console.warn('WARNING', ...args) }, error(...args) { - console.log('ERROR', ...args) + console.error('ERROR', ...args) }, } diff --git a/src/views/Room.vue b/src/views/Room.vue index 9381412..db4aea1 100644 --- a/src/views/Room.vue +++ b/src/views/Room.vue @@ -98,7 +98,7 @@ export default { }) rtc.on("local_stream_error", (error) => { - logger.log("local stream error", error) + logger.error("local stream error", error) this.waiting = false this.uiState = [UserMediaConfigurator, { error: "local_stream_error" }] }) @@ -167,6 +167,28 @@ export default { // logger.log("rtc session destroyed", peer) // }) + // CONNECTION STATUS + + rtc.on("peer_connection_pending", (peer) => { + logger.log("peer connection pending", peer) + }) + + rtc.on("peer_connection_established", (peer) => { + logger.log("peer connection established", peer) + }) + + rtc.on("peer_connection_disconnected", (peer) => { + logger.warn("peer connection disconnected", peer) + }) + + rtc.on("peer_connection_closed", (peer) => { + logger.warn("peer connection closed", peer) + }) + + rtc.on("peer_connection_failed", (peer) => { + logger.error("peer connection failed", peer) + }) + return rtc }, joinRoom(userMediaConfig) {