Minetrack/lib/logger.js
2023-12-30 23:03:54 +00:00

18 lines
373 B
JavaScript

const winston = require("winston");
winston.remove(winston.transports.Console);
winston.add(winston.transports.File, {
filename: "minetrack.log",
});
winston.add(winston.transports.Console, {
timestamp: () => {
const date = new Date();
return date.toLocaleTimeString() + " " + date.toLocaleDateString();
},
colorize: true,
});
module.exports = winston;