Created
January 10, 2012 03:37
-
-
Save hongymagic/1586738 to your computer and use it in GitHub Desktop.
Simple log wrapper which prints line numbers...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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