Created
March 13, 2014 02:08
-
-
Save tarwn/9520722 to your computer and use it in GitHub Desktop.
Awesomify-er your console.log - extended from https://gist.github.com/LeaVerou/9518902
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
(function(){ | |
var log = console.log; | |
console.log = function(str) { | |
var css = 'background-image: url("http://fc07.deviantart.net/fs70/f/2013/090/3/5/ocs____seine_unicorn_sprite_by_onisuu-d5zuuax.gif"), linear-gradient(to right, red, yellow, lime, aqua, blue, fuchsia, red); background-repeat: no-repeat, no-repeat; padding-left: 20px; color: white; font-weight: bold; font-size: 12pt; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;'; | |
var args = Array.prototype.slice.call(arguments); | |
args[0] = '%c ' + args[0]; | |
args.splice(1,0,css); | |
return log.apply(console, args); | |
} | |
})(); |
Bug fixed, should be good to go in some future release. Apparently background-repeat wasn't considered to be a valid property by one of blink's css parsers... which makes me wonder how it worked on webpages.
(function(){
var log = console.log;
console.log = function(str) {
var css = 'background-image: url(data:image/gif;base64,R0lGODlhFQAVAKIHAP//wk8UG2znwl21s1NsmPeuwt91sf///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJFAAHACwAAAAAFQAVAAADdHi63L4BvhlArJGyMETAlLd1QWFtVyAq1QAYJysMKs1WQJ7btSAAs48O4MqtVMCOB2fU2Q6qmfQy1AWjAwIJwqzuCL4Mymt9OrpVsHlDznHEZ/JlwnILT/C4ZelePSozJElbf0QEHy2HeRsFBhkljnRcKA4JACH5BAUUAAcALAAAAAAVABUAAAN1eBp63DAuwAKV7a0hgtVR0EEBFxRXVomaNQBG6giDWC8WoOu3LQgAmmcHeOlGsyCnkzvubjOatELcCUU0gklVrQ4IPxCua4VKml2wmUTWlcTsbgWTcQ8v8Dgrx6I7lCaASGdFBB4uhnkLBQYPJ41+KiSKkX4JADs=), linear-gradient(to right, red, yellow, lime, aqua, blue, fuchsia, red); background-repeat: no-repeat, no-repeat; padding-left: 20px; color: white; font-weight: bold; font-size: 12pt; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;';
var args = Array.prototype.slice.call(arguments);
args[0] = '%c ' + args[0];
args.splice(1,0,css);
return log.apply(console, args);
}
})();
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Filed http://crbug.com/352140 for the Chrome no-repeat problem.