Skip to content

Instantly share code, notes, and snippets.

@iahu
Last active Sep 28, 2015
Embed
What would you like to do?
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