Style your JavaScript console logging

2015-10-11 00:00:00 by Mike

Here's a simple technique to help you spot your console debugging. Simply precede the logging message with '%c' and pass the log style you want as a string of CSS to the console.log function. Like this:

console.log('%c Stand out with console.log style ', 'padding:2px; background: #111; color: #7cd');

If you are using Chrome or Firefox you'll be fortunate enough to see this: