From fcd385c36adfb7beca0f85485b2018365173f4f2 Mon Sep 17 00:00:00 2001 From: HanishKVC Date: Tue, 28 May 2024 23:16:18 +0530 Subject: [PATCH] SimpleChat: Disable console debug by default by making it dummy Parallely save a reference to the original func. --- examples/server/public_simplechat/simplechat.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/server/public_simplechat/simplechat.js b/examples/server/public_simplechat/simplechat.js index 551d9c519..bcbb8f5c0 100644 --- a/examples/server/public_simplechat/simplechat.js +++ b/examples/server/public_simplechat/simplechat.js @@ -672,6 +672,16 @@ class Me { }; } + /** + * Disable console.debug by mapping it to a empty function. + */ + debug_disable() { + this.console_debug = console.debug; + console.debug = () => { + + }; + } + /** * Show the configurable parameters info in the passed Div element. * @param {HTMLDivElement} elDiv @@ -744,6 +754,7 @@ let gMe; function startme() { console.log("INFO:SimpleChat:StartMe:Starting..."); gMe = new Me(); + gMe.debug_disable(); document["gMe"] = gMe; document["du"] = du; for (let cid of gMe.defaultChatIds) {