@sh4manik/betterlog.js

1.0.7 • Public • Published

BetterLog.js

version npm

JavaScript library

BetterLog.js is a lightweight and fast JavaScript library that improves the logging experience by adding many new features and customization.

Documentation

Quick Start (Browser)

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();

Quick Start (Node.js)

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.js

In JavaScript code, you need to create an object:

const BetterLog = require('@sh4manik/betterlog.js');
let cons = new BetterLog();

Improved console output

cons.success('Success!');
cons.debug('Debug!');
cons.info('Info!');
cons.warn('Warn!');
cons.error('Error!');

Output:

Screenshot_1

Custom console 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:

Screenshot_2

Tests in the browser

cons.test(4, 2 + 2);
cons.test(5, 3 + 6);

Output:

Screenshot_3

Mute console 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:

Screenshot_4

Readme

Keywords

none

Package Sidebar

Install

npm i @sh4manik/betterlog.js

Weekly Downloads

7

Version

1.0.7

License

ISC

Unpacked Size

17.9 kB

Total Files

9

Last publish

Collaborators

  • sh4manik