2020-04-21 22:59:53 +00:00
|
|
|
const winston = require('winston')
|
2015-11-02 05:46:24 +00:00
|
|
|
|
2020-04-21 22:59:53 +00:00
|
|
|
winston.remove(winston.transports.Console)
|
2015-11-02 05:46:24 +00:00
|
|
|
|
2020-04-21 22:59:53 +00:00
|
|
|
winston.add(winston.transports.File, {
|
|
|
|
filename: 'minetrack.log'
|
|
|
|
})
|
2015-11-02 07:04:49 +00:00
|
|
|
|
2015-11-02 05:46:24 +00:00
|
|
|
winston.add(winston.transports.Console, {
|
2020-04-21 22:59:53 +00:00
|
|
|
timestamp: () => {
|
|
|
|
const date = new Date()
|
|
|
|
return date.toLocaleTimeString() + ' ' + date.getDate() + '/' + (date.getMonth() + 1) + '/' + date.getFullYear().toString().substring(2, 4)
|
|
|
|
},
|
|
|
|
colorize: true
|
|
|
|
})
|
2015-11-02 06:01:04 +00:00
|
|
|
|
2020-04-21 22:59:53 +00:00
|
|
|
module.exports = winston
|