BetterLog.js is a lightweight and fast JavaScript library that improves the logging experience by adding many new features and customization.
First you need to import the library. To do this, you need to write a script connection in the HTML file:
<script src="https://sh4man4ik.github.io/BetterLog.js/betterlog.js"></script>In JavaScript code, you need to create an object:
let cons = new BetterLog();First you need to download the library. But note that many things that work in the browser may not work in the console. You can do this with the command:
npm install @sh4manik/betterlog.jsIn JavaScript code, you need to create an object:
const BetterLog = require('@sh4manik/betterlog.js');
let cons = new BetterLog();cons.success('Success!');cons.debug('Debug!');cons.info('Info!');cons.warn('Warn!');cons.error('Error!');Output:
You can choose which styles you want to apply to your output. The example shows all styles.
cons.custom("Custom text").color('#000000').background_color('#ffffff').font_size('16px').text_decoration('underline').bold().padding('0px', '20px').log();Output:
cons.test(4, 2 + 2);cons.test(5, 3 + 6);Output:
You can mute some of the outputs in the console when you need.
cons.mute();
cons.success('Hello');
cons.unmute();
cons.success('World');Output:



