Skip to content

Instantly share code, notes, and snippets.

@primaryobjects
Created June 8, 2017 18:20
Show Gist options
  • Select an option

  • Save primaryobjects/ef24a4ba0ff73c45db99fd0d975fb57d to your computer and use it in GitHub Desktop.

Select an option

Save primaryobjects/ef24a4ba0ff73c45db99fd0d975fb57d to your computer and use it in GitHub Desktop.
Overwrites console.log to send messages to a server.
(function(){
var oldLog = console.log;
console.log = function (message) {
// DO MESSAGE HERE.
alert('hi!');
oldLog.apply(console, arguments);
};
})();
  1. Paste the above code into the Chrome inspector.
  2. At the Chrome inspector console prompt, type:
console.log('hi');
  1. The result will be an alert message and console.log message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment