Saturday 27 June 2015

Customize your console statements with CSS


Hi folks, I came across this very useful article today that taught me how to customize console.log statements that I use so much. (The developer in me.. ;) ). Thought of sharing it with you guys.


At any rate, the first thing you would ask me,why on earth would anyone want to customize them in the first place? Well, when you have heaps of those console statements during project development, you will understand why…:P. Still don’t believe me, take a look at the pic below.




As far the implementation is concerned, it’s a piece of cake.
Paste the following line of code in your developer console and see the magic!!!


console.log("%c%s", "background: red; color: white" , "How easy is it to find me");


Note: To open the developer console, right click anywhere on a webpage and click on Inspect Element in the pop up menu that appears.


Hope this turns out to be helpful to you guys too. Peace.