Colors in JavaScript console

In Chrome & Firefox (+31) you can add CSS in console.log messages:

console.log('%c Oh my heavens! ', 'background: #222; color: #bada55');

Console color example in Chrome

The same can be applied for adding multiple CSS to same command.
syntax for multi coloring chrome console messages

References

  • MDN: Styling console output
  • Chrome: Console API Reference

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)