galactic-bot/middleware/logger/transports/DiscordWebhook.js

24 lines
536 B
JavaScript
Raw Normal View History

2020-04-13 22:38:10 +02:00
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;