Minetrack/lib/logger.js

18 lines
373 B
JavaScript
Raw Permalink Normal View History

2023-12-30 23:03:54 +00:00
const winston = require("winston");
2015-11-02 05:46:24 +00:00
2023-12-30 23:03:54 +00:00
winston.remove(winston.transports.Console);
2015-11-02 05:46:24 +00:00
winston.add(winston.transports.File, {
2023-12-30 23:03:54 +00:00
filename: "minetrack.log",
});
2015-11-02 07:04:49 +00:00
2015-11-02 05:46:24 +00:00
winston.add(winston.transports.Console, {
timestamp: () => {
2023-12-30 23:03:54 +00:00
const date = new Date();
return date.toLocaleTimeString() + " " + date.toLocaleDateString();
},
2023-12-30 23:03:54 +00:00
colorize: true,
});
2015-11-02 06:01:04 +00:00
2023-12-30 23:03:54 +00:00
module.exports = winston;