Skip to content

Instantly share code, notes, and snippets.

@iahu
Last active September 28, 2015 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iahu/7efcec628f7d8737e3e4 to your computer and use it in GitHub Desktop.
Save iahu/7efcec628f7d8737e3e4 to your computer and use it in GitHub Desktop.
js console wrapper,can print original call code line number
var log = (function () {
if ( console && typeof console.log === 'function' ) {
if (console.log.bind) {
return console.log.bind(console);
} else {
return $.proxy(console.log, console);
}
} else {
return function () {
var log = window.__im_log = window.__im_log || [];
log.push( Array.prototype.join.call(arguments, ' ') );
};
}
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment