Enable & Disable Console Log With The jsconsole Library

Category: Javascript | October 26, 2021
Author:Zuks86
Views Total:754 views
Official Page:Go to website
Last Update:October 26, 2021
License:MIT

Preview:

Enable & Disable Console Log With The jsconsole Library

Description:

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