first commit
This commit is contained in:
commit
aa7869eb33
386 files changed
+69375
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user