However most of the time our logs are monotonous and boring, which is why I’m sure you’d be happy to learn there’s a way to spice things up with styled console logs. Yep, you heard right!
console.log('%c Do not hold the wrong end of a chainsaw ', 'font-size: 4em; font-style: italic; background: #3fae47; color: white');
console.log('%cDo not hold the %cwrong%c end of a %cchainsaw%c', 'font-size:3em;', 'font-size:3em;font-weight:bold;text-decoration:underline;color:orange', 'font-weight:normal;font-size:3em', 'color:black;font-size:4em;color:red;font-style:italic;font-weight:bold;', 'color:black');
For The True Artists
One excellent use-case is attracting good web developers (the curious type) to your team, as you can see below Pinterest and toggl.com are doing. Another great example is Facebook’s console log warning for protecting non tech-savvy users from social-hacking, also below.
Leave A Comment