{"id":4065,"date":"2021-11-03T18:23:38","date_gmt":"2021-11-03T10:23:38","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4065"},"modified":"2025-04-11T13:48:46","modified_gmt":"2025-04-11T05:48:46","slug":"console-logging","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/web-toolkit\/console-logging\/","title":{"rendered":"Console Logging: Web SDK &#8211; Video API"},"content":{"rendered":"\n<p>The Web SDK logs as posted on the browser console help to debug the application during development. You can access and control the logs for a more efficient debug process using the following methods. <\/p>\n\n\n\n<h4>Table of Contents<\/h4>\n\n\n\n<ul><li><a href=\"#set-log-level\">Set Log Level<\/a><\/li><li><a href=\"#get-log-dump\">Get Log Dump<\/a><\/li><li><a href=\"#share-log\">Share Log to audit<\/a><\/li><\/ul>\n\n\n\n<a name=\"set-log-level\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Set Log Level<\/h3>\n\n\n\n<p>The IO Operations to write logs is a considerably time-consuming task. Therefore, you need granular control over the type of log the SDK writes on browser console to:<\/p>\n\n\n\n<ul><li>Get optimum log entries for debugging or audit process.<\/li><li>Ensure faster communication and media flow with the Portal.<\/li><\/ul>\n\n\n\n<p><strong>Class:<\/strong> <code>EnxRtc<\/code><\/p>\n\n\n\n<p><strong>Method: <\/strong><code>EnxRtc.Logger.setLogLevel(Level)<\/code><\/p>\n\n\n\n<p><strong>Levels: <\/strong><code>0-5<\/code> &#8211; in descending order of log detail. Default is 0.<\/p>\n\n\n\n<ul><li><strong>0<\/strong> = DEBUG<\/li><li><strong>1<\/strong> = TRACE<\/li><li><strong>2<\/strong> = INFO<\/li><li><strong>3<\/strong> = WARNING<\/li><li><strong>4<\/strong> = ERROR<\/li><li><strong>5<\/strong> = NONE <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">EnxRtc.Logger.setLogLevel(3); \nEnxRtc.Logger.setLogLevel(WARNING); \/\/ Alternate way<\/pre>\n\n\n\n<a name=\"get-log-dump\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Get Log Dump <\/h3>\n\n\n\n<p>The <code>Logger.setOutputFunction()<\/code> allows you to access the logs apart from the browser console such as by sending it via mail or by creating a UI.<\/p>\n\n\n\n<p> <strong>Method: <\/strong><code>EnxRtc.Logger.setOutputFunction(Callback)<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>EnxRtc.Logger.setOutputFunction( function(response) {<\/code>\n       \/\/ Use response\n}); <\/pre>\n\n\n\n<a name=\"share-log\"><\/a>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Share Log to audit<\/h3>\n\n\n\n<p>The <code>EnxRtc.postClientLogs()<\/code> method allows you to send latest 500 lines of console logs to the Portal using HTTP Post. You should ideally request for user\u2019s consent before you post log to the Portal.<\/p>\n\n\n\n<p><strong>Method: <\/strong><code>EnxRtc.postClientLogs(Token, Callback)<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">if( confirm(\"You are posting Browser Console Log to audit.nSure?\")) {\n      room.postClientLogs(token, function(res) {\n           Logger.info(res.message);   \n      });\n}<\/pre>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<p> \u2190  <a href=\"..\/session-extension-closure\/#extend-session\">Extend Session<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-center\"> <a href=\"..\/\">Index<\/a> <\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-right\"><a href=\"..\/pre-call-test\/\">Pre-Call Test<\/a> \u2192 <\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Web SDK logs as posted on the browser console help to debug the application during development. You can access and control the logs for a more efficient debug process using the following methods. Table of Contents Set Log Level Get Log Dump Share Log to audit Set Log Level The IO Operations to write logs is a considerably time-consuming task. Therefore, you need granular control over the type of&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3724,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ub_ctt_via":""},"featured_image_src":null,"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"featured":false,"featured-large":false},"uagb_author_info":{"display_name":"vcxdevwpadmin","author_link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/author\/vcxdevwpadmin\/"},"uagb_comment_info":0,"uagb_excerpt":"The Web SDK logs as posted on the browser console help to debug the application during development. You can access and control the logs for a more efficient debug process using the following methods. Table of Contents Set Log Level Get Log Dump Share Log to audit Set Log Level The IO Operations to write&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4065"}],"collection":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/comments?post=4065"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4065\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3724"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}