modelo-log is a quick wrap of winston for our use in modelo
Install
npm install modelo-log
Features
- customize output ways (to console or/and log file)
- Save daily logs to
${process.cwd()}/logs/hostIp-date.txt
; sample filename:10.10.11.11-2016-10-08.txt
util functions
-
filterSensitive()
var logger = ;logger// return {username: abc, password: ******, credit: '************7578'}
Sample usage
var logger = ;logger logger;// 2016-11-14T12:47:32.204Z info: [TAG] this is a message logger;// 2016-11-14T12:47:32.204Z warn: [TAGE2] notice, here is a warning logger;// 2016-11-14T12:47:32.204Z error:[HTTP] an error! shit loggerprofile'testTime';;// 2016-11-14T12:47:32.204Z info: [testTime] testTime {"durationMs":13}
Note
The first argument represent TAG of the log