24 lines
536 B
JavaScript
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;
|