The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/rocketchat-lib/server/lib/debug.js

38 lines
919 B

var logger = new Logger('Meteor', {
methods: {
method: {
type: 'debug'
},
publish: {
type: 'debug'
}
}
});
var wrapMethods = function(name, originalHandler, methodsMap) {
methodsMap[name] = function() {
var args = name === 'ufsWrite' ? Array.prototype.slice.call(arguments, 1) : arguments;
logger.method(name, '-> userId:', Meteor.userId(), ', arguments: ', args);
return originalHandler.apply(this, arguments);
};
};
var originalMeteorMethods = Meteor.methods;
Meteor.methods = function(methodMap) {
_.each(methodMap, function(handler, name) {
wrapMethods(name, handler, methodMap);
});
originalMeteorMethods(methodMap);
};
var originalMeteorPublish = Meteor.publish;
Meteor.publish = function(name, func) {
return originalMeteorPublish(name, function() {
logger.publish(name, '-> userId:', this.userId, ', arguments: ', arguments);
return func.apply(this, arguments);
});
};