1.0.1 • Published 4 years ago

nice-logs v1.0.1

Weekly downloads
10
License
MIT
Repository
github
Last release
4 years ago

Nice Logs

npm.io

Website

A pretty nice, colorful and lightweight console log for the browser. Prints a line with log type and high resolution time stamp. With integrated TypeScript type definitions.

Install

npm i nice-logs

NPM Package

Usage

Log.title('This is a title log.');
Log.info('This is an info message.');
Log.warn('This is a warn message.');
Log.error('This is an error message.');
Log.success('This is a success message.');

// How to replace `console.log(...)`?
Log.info('...');

// Just log time.
Log.info();

// Do not log time.
Log.timeStampEnabled = false;
Log.info('No time stamp here.');

// I want to use own style. (Experimental)
Log.logStyle.info = 'color: blue';
Log.modeText.info = 'LOL';
Log.info('Hehe');

Troubleshoot

This should work with all Chromium browsers like Chrome, Opera and the "new" Edge browser. (The Edge with Chromium. The old one does not support it.) It also works with Firefox. Not tested in Safari. NodeJS is not supported. Maybe in the future.