1.1.1 • Published 2 years ago
@raycas/pretty-logger v1.1.1
Pretty-Logger 🚀
Pretty-logger is a light and simple alternative to console.log. It allows you to console Warning, Error ed Info with a unique styles.
Install
You can install it through the npm packet manager typing
npm i @raycas/pretty-logger --save-dev
Usage
It is very simple to use and you can use it with vanilla JavaScript or with Framework like Angular or a library like React.
new Logger(isProduction: boolean)
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]
logger(...items: any) ⚡
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]
1.1.1
2 years ago
1.1.0
2 years ago
1.0.1-alpha.12
2 years ago
1.0.1-alpha.11
2 years ago
1.0.1-alpha.10
2 years ago
1.0.1-alpha.9
2 years ago
1.0.1-alpha.8
2 years ago
1.0.1-alpha.7
2 years ago
1.0.1-alpha.6
2 years ago
1.0.1-alpha.5
2 years ago
1.0.1-alpha.4
2 years ago
1.0.1-alpha.3
2 years ago
1.0.1-alpha.2
2 years ago
1.0.1-alpha.1
2 years ago