Skip to content

Instantly share code, notes, and snippets.

@aklinkert
Last active January 14, 2019 19:42
Show Gist options
  • Save aklinkert/8660031 to your computer and use it in GitHub Desktop.
Save aklinkert/8660031 to your computer and use it in GitHub Desktop.
Log all Sockets Events of an socket.io client
(function() {
var emit = socket.emit;
socket.emit = function() {
console.log('***','emit', Array.prototype.slice.call(arguments));
emit.apply(socket, arguments);
};
var $emit = socket.$emit;
socket.$emit = function() {
console.log('***','on',Array.prototype.slice.call(arguments));
$emit.apply(socket, arguments);
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment