Enable & Disable Console Log With The jsconsole Library

Category: Javascript | October 26, 2021
AuthorZuks86
Last UpdateOctober 26, 2021
LicenseMIT
Views1,195 views
Enable & Disable Console Log With The jsconsole Library

jsconsole is a vanilla JavaScript console manipulation library that allows you to enable and disable browse console log programmatically.

How to use it:

1. Load the jsconsole Library into the document.

<script src="jsconsole.js"></script>

2. Disable the console log entirely.

console.active = false;

3. Re-enable the console log.

console.active = true;

4. You can also enable & disable specific types of console log.

// disable
console.doLog = false;
console.doInfo = false;
// enable
console.doLog = true;
console.doInfo = true;

5. Disable the user to clear the console log.

console.doClear;

You Might Be Interested In:


Leave a Reply