galactic-bot/Logger.js
2020-04-09 15:08:28 -06:00

25 lines
597 B
JavaScript

const winston = require('winston');
const moment = require('moment');
class Logger {
constructor(manager) {
this.manager = manager;
this.logger = winston.createLogger({
transports: [
new winston.transports.Console(),
new winston.transports.File({ filename: `${Date.now()}.log` }),
new winston.transports.File({ filename: `${Date.now()}-error.log`, level: 'error' })
]
});
}
get date() {
return moment().format("MM/DD/YYYY hh:mm:ss");
}
}
module.exports = Logger;