Get unlimited public & private packages + team-based management with npm Teams.Learn more »

tanand-logger

0.0.19 • Public • Published

Tanand Logger

Sample Usage:

const logger = require('tanand-logger')('APP');
const logger2 = require('tanand-logger')('DatabaseSvc');

logger.info('This is a info message');
logger2.info('This is a info message');
logger.info('This is a info with object', { test: 'Missing!!', fake: true});
logger.debug('This is a debug message');
logger.warn('This is a warn message');
logger.error('This is a error message');

Output:

2018-02-21T14:20:23+08:00	INFO	[APP]          	This is a info message
2018-02-21T14:20:23+08:00	INFO	[DatabaseSvc]  	This is a info message
2018-02-21T14:20:23+08:00	INFO	[APP]          	This is a info with object, {"test":"Missing!!","fake":true}
2018-02-21T14:20:23+08:00	DEBUG	[APP]          	This is a debug message
2018-02-21T14:20:23+08:00	WARN 	[APP]          	This is a warn message
2018-02-21T14:20:23+08:00	ERROR	[APP]          	This is a error message

Keywords

Install

npm i tanand-logger

DownloadsWeekly Downloads

10

Version

0.0.19

License

ISC

Unpacked Size

5.55 kB

Total Files

7

Last publish

Collaborators

  • avatar