Pretty-logger is a light and simple alternative to console.log. It allows you to console Warning, Error ed Info with a unique styles.
You can install it through the npm packet manager typing
npm i @raycas/pretty-logger --save-dev
It is very simple to use and you can use it with vanilla JavaScript or with Framework like Angular or a library like React.
It allows you to instantiate a new istance of the Logger class and define if it is production mode or not. If isProduction is setted to true no log will show.
import { Logger } from '@raycas/pretty-logger';
const logger = new Logger(false);
logger.info('Hello', { world: 'test' }, 'lorem'); //[ℹINFO]: [Hello] { world: 'test' } [lorem]
logger.error('Hello', { world: 'test' }, 'lorem'); //[☠ERROR]: [Hello] { world: 'test' } [lorem]
logger.warn('Hello', { world: 'test' }, 'lorem'); //[⚠WARN]: [Hello] { world: 'test' } [lorem]
It Allows you to console the items without istantiate the Logger class
import { logger } from '@raycas/pretty-logger';
logger.info('Hello', { world: 'test' }, 'lorem'); //[ℹINFO]: [Hello] { world: 'test' } [lorem]
logger.error('Hello', { world: 'test' }, 'lorem'); //[☠ERROR]: [Hello] { world: 'test' } [lorem]
logger.warn('Hello', { world: 'test' }, 'lorem'); //[⚠WARN]: [Hello] { world: 'test' } [lorem]