Created
March 31, 2012 10:49
-
-
Save aben/2261937 to your computer and use it in GitHub Desktop.
console.js
This file contains 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
var _e = function(){}; | |
if( typeof console != 'undefined' ){ | |
_e = function(){ | |
var date = new Date() | |
,now = [ date.toLocaleTimeString(), '.', date.getMilliseconds(), ' -> ' ].join(''); | |
if( arguments.length === 1 && typeof arguments[0] !== 'object' ){ | |
console.log( '%c%d%o', 'font-style:italic;font-size:10px;', now, arguments[0] ); | |
}else{ | |
console.info( '%c%d%o', 'font-style:italic;font-size:10px;', now, arguments ); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment