galactic-bot/middleware/logger/transports/DiscordWebhook.js
2020-04-13 14:38:10 -06:00

24 lines
536 B
JavaScript

const Transport = require('winston-transport');
class DiscordWebhook extends Transport {
constructor(opts) {
super(opts);
//
// Consume any custom options here. e.g.:
// - Connection information for databases
// - Authentication information for APIs (e.g. loggly, papertrail,
// logentries, etc.).
//
}
log(info, callback) {
setImmediate(() => {
this.emit('logged', info);
});
// Perform the writing to the remote service
callback();
}
};
module.exports = DiscordWebhook;