Skip to content

Instantly share code, notes, and snippets.

@hongymagic
Created January 10, 2012 03:37
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 hongymagic/1586738 to your computer and use it in GitHub Desktop.
Save hongymagic/1586738 to your computer and use it in GitHub Desktop.
Simple log wrapper which prints line numbers...
window.log = (function (console) {
'use strict';
var COUNT = 0;
return function () {
var args = Array.prototype.slice.call(arguments),
line = [++COUNT + ':'];
if (typeof console === 'object') {
console.log.apply(console, line.concat(args));
}
};
}(console));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment