Skip to content

Instantly share code, notes, and snippets.

@joshhunt
Forked from cfj/consoleLoge.js
Created March 31, 2014 12:41
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 joshhunt/9891421 to your computer and use it in GitHub Desktop.
Save joshhunt/9891421 to your computer and use it in GitHub Desktop.
window.console.loge = function (msg) {
var gifs = ['wink','shake-space','peepers','prizza','hat','gradient','fat','rainbow','sunglasses','derp','shake'],
wow = ['', 'wow! ', 'amaze! ', 'dazzle! '],
adjs = ['so', 'such', 'many', 'much', 'very'],
randomizr = function (a) { return a[Math.floor(Math.random() * a.length)];},
message = '%c ' + randomizr(wow) + randomizr(adjs) + ' ' + typeof msg + ': ',
css = 'background-image: url(http://d1e3ezyatlol8u.cloudfront.net/img/212/doge-' + randomizr(gifs) + '-212.gif); background-size: 80px 80px; background-repeat: no-repeat; font-family: \'Comic Sans MS\', cursive; padding: 25px; line-height: 64px; color: white; font-weight: 800; width: 100%; display: block;';
console.log.apply(console, typeof msg === 'object' ? [message, css, msg] : [message += msg, css]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment