The Web SDK writes different type of logs to the browser console to  help in debugging at development phase. EnableX provides two methods to access and control these log entries.

Table of Contents

Enable Log

The IO Operations to write log may be a considerably time-consuming task. Therefore, you may like to have control to enable or disable logging.

Method: enableLogs(enable)

Parameters: @param {boolean} enable – Set true to enable and false to disable logging

window.EnxRtc.enableLogs(true);	        // To enable logging
window.EnxRtc.enableLogs(false);	// To disable logging

Share Log with EnableX to audit

To share console logs with EnableX Tech Team use the available method in SDK. The method sends the latest 500 lines of console log to EnableX using HTTP Post. You may need to build your own UI around it. Please request for the user’s consent before you post logs to EnableX.

You must enable logging before you can share it.

Method: postClientLogs()

Event Listeners: onLogUploaded

// To post logs
window.EnxRtc.postClientLogs();
// Add Listener to listen success
window.EnxRtc.addEventListner("onLogUploaded",
console.log(JSON.stringify(data.data));