Skip to content

Instantly share code, notes, and snippets.

@aben
Created March 31, 2012 10:49
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 aben/2261937 to your computer and use it in GitHub Desktop.
Save aben/2261937 to your computer and use it in GitHub Desktop.
console.js
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