Implement Winston powered logger

This commit is contained in:
Cryptkeeper
2015-11-01 23:46:24 -06:00
parent eb75acf754
commit dec1536c6c
5 changed files with 36 additions and 14 deletions

17
lib/logger.js Normal file
View File

@ -0,0 +1,17 @@
var winston = require('winston');
winston.remove(winston.transports.Console);
winston.add(winston.transports.File, {
filename: 'minetrack.log'
});
winston.add(winston.transports.Console, {
'timestamp': function() {
var date = new Date();
return date.toLocaleTimeString() + " " + date.getDate() + "/" + (date.getMonth() + 1) + "/" + date.getFullYear().toString().substring(2, 4);
},
'colorize': true
});
module.exports = winston;