first commit

This commit is contained in:
Francois Klieber committed 2021-06-06 20:25:14 +02:00
commit aa7869eb33
386 files changed
+69375

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
const log = require('../core/log');
const _ = require('lodash');
const subscriptions = require('../subscriptions');
const config = require('../core/util').getConfig().eventLogger;
const EventLogger = function() {}
_.each(subscriptions, sub => {
if(config.whitelist && !config.whitelist.includes(sub.event)) {
return;
}
EventLogger.prototype[sub.handler] = (event, next) => {
log.info(`\t\t\t\t[EVENT ${sub.event}]\n`, event);
if(_.isFunction(next))
next();
}
});
module.exports = EventLogger;