diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index 13ebba69945..ca605290689 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -171,14 +171,17 @@ WebrtcGlobalInformation.prototype = { } }, - getCandPairLogs: function(candPairId, callback, errorCallback) { - let pattern = 'CAND-PAIR(' + candPairId + ')'; + getLogs: function(pattern, callback, errorCallback) { if (_globalPCList) { _globalPCList.getLoggingFromFirstPC(pattern, callback, errorCallback); } else { errorCallback("No global PeerConnection list"); } }, + + getCandPairLogs: function(candPairId, callback, errorCallback) { + this.getLogs('CAND-PAIR(' + candPairId + ')', callback, errorCallback); + }, }; function RTCIceCandidate() { diff --git a/dom/webidl/RTCPeerConnection.webidl b/dom/webidl/RTCPeerConnection.webidl index 0df14cca1c9..bff41a7e21f 100644 --- a/dom/webidl/RTCPeerConnection.webidl +++ b/dom/webidl/RTCPeerConnection.webidl @@ -150,6 +150,9 @@ interface WebrtcGlobalInformation { void getCandPairLogs(DOMString candPairId, RTCLogCallback callback, RTCPeerConnectionErrorCallback errorCallback); + void getLogs(DOMString pattern, + RTCLogCallback callback, + RTCPeerConnectionErrorCallback errorCallback); }; diff --git a/toolkit/content/aboutWebrtc.xhtml b/toolkit/content/aboutWebrtc.xhtml index 3c33f10af2c..3ae11b7e0c3 100644 --- a/toolkit/content/aboutWebrtc.xhtml +++ b/toolkit/content/aboutWebrtc.xhtml @@ -24,6 +24,15 @@ function getCandPairLogs(id) { } } +function getAllLogs() { + try { + var wg = new WebrtcGlobalInformation(); + wg.getLogs('', displayLogs, console.log); + } catch(e) { + console.log("Exception while creating WebrtcGlobalInformation" + e.toString()); + } +} + function displayLogs(logs) { var logsDiv = document.getElementById('logs'); while (logsDiv.lastChild) { @@ -34,7 +43,7 @@ function displayLogs(logs) { logs.forEach(function(logLine){ logsDiv.appendChild(document.createElement('div')) .appendChild(document.createTextNode(logLine)); - }); + }); } function buildCandPairTableRow(candPair, stats) { @@ -214,6 +223,7 @@ var statsDisplay = setInterval(refreshStats, 1000);
+