Skip to content

Instantly share code, notes, and snippets.

@ryjoyce
Forked from toddmotto/consoleLoge.js
Last active August 29, 2015 13:57
Show Gist options
  • Save ryjoyce/9830128 to your computer and use it in GitHub Desktop.
Save ryjoyce/9830128 to your computer and use it in GitHub Desktop.
(function () {
'use strict';
var wow = ['', 'wow\n'];
var adjs = 'so such many much very'.split(' ');
var colr = ['ff0000', '00ff00', '0000ff'];
var randomizr = function (a) {
return a[Math.floor(Math.random() * a.length)];
};
var colourizr = function(val) {
return ['%c' + val, 'color:#'+randomizr(colr)+';font-size:3em;font-family:Comic Sans,Comic Sans MS,cursive;'];
};
if (window.console && !console.loge) {
console.loge = function (msg) {
console.log.apply(console, colourizr(randomizr(wow) + randomizr(adjs) + ' ' + msg))
};
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment