Skip to content

Instantly share code, notes, and snippets.

@chadfurman
Created August 6, 2015 13:11
Show Gist options
  • Save chadfurman/b2faf63615894c5a9eca to your computer and use it in GitHub Desktop.
Save chadfurman/b2faf63615894c5a9eca to your computer and use it in GitHub Desktop.
module.exports = function(robot) {
response_orig = {
send: robot.Response.prototype.send,
reply: robot.Response.prototype.reply
}
robot.Response.prototype.send = function() {
var args = Array.prototype.slice.call(arguments);
log_it(this, args);
response_orig.send.call(this, args);
}
//robot.Response.prototype.reply = function() {
// console.log(arguments);
// var args = Array.prototype.slice.call(arguments);
// console.log('replying (args: ' + args + ') (message: ' + this.message + ')');
// log_it(this.message, args);
// response_orig.reply.call(this, args);
//}
};
function log_it(message, data) {
console.log('this.message:' + JSON.stringify(this.message, null, '\t'));
console.log('this.envelope:' + JSON.stringify(this.envelope, null, '\t'));
console.log(arguments);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment