0.2.1 • Published 3 years ago

log-prettier v0.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Console logs Prettier

Instalation:

npm i log-prettier

Using:

import { logger } from 'log-prettier';

logger.info('SomeParams', someParams);
logger.debug('SomeParams', someParams);
logger.warn('SomeParams', someParams);
logger.error('SomeParams', someParams);

Supporting any params count and format same which console logs.

Customization:

Custom Config:
ParamsDescription
infoBackgroundColorBackground color for info label (supports HTML/CSS color names, hex (with #), and rgba colors)
infoTitleText for info label (could contain emoji)
debugBackgroundColorBackground color for debug label (supports HTML/CSS color names, hex (with #), and rgba colors)
debugTitleText for debug label (could contain emoji)
warnBackgroundColorBackground color for warn label (supports HTML/CSS color names, hex (with #), and rgba colors)
warnTitleText for warn label (could contain emoji)
warnTracebackOnShow warn traceback as console.warn or just show data (default is false)
errorBackgroundColorBackground color for error label (supports HTML/CSS color names, hex (with #), and rgba colors)
errorTitleText for error label (could contain emoji)
errorTracebackOnShow error traceback as console.error or just show data (default is false)
Using:
import { logger } from 'log-prettier';

logger.init({
	someParam: customValue,
});

Preview:

alt text