2018-08-04 21:46:25 +00:00
|
|
|
var Winston = require("winston");
|
|
|
|
var config = require("../config");
|
|
|
|
var ENV = config.get('build');
|
|
|
|
|
|
|
|
function getLogger(module) {
|
|
|
|
var path = module.filename.split('/').slice(-2).join('/');
|
|
|
|
|
2018-08-29 19:54:18 +00:00
|
|
|
return Winston.createLogger({
|
2018-08-04 21:46:25 +00:00
|
|
|
transports: [
|
|
|
|
new Winston.transports.Console({
|
|
|
|
colorize: true,
|
|
|
|
level: ENV == 'debug' ? 'debug' : 'error'
|
|
|
|
})
|
|
|
|
]
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = getLogger;
|