forked from Galactic/galactic-bot
25 lines
597 B
JavaScript
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; |