Search code examples
javascriptfacebookgoogle-chromegoogle-chrome-devtools

How to get formatted console message in Google Chrome's developer tools?


Today I was surprised by getting a formatted console message while surfing on Facebook.

I have no need to use formatted console messages at the moment but I was wondering how to print formatted console messages? Is this just a chrome feature?

I'm using Google Chrome on my Macbook.

Formatted console messages


Solution

  • console.log("%cThis will be formatted with large, blue text", "color: blue; font-size: x-large");
    

    https://developers.google.com/web/tools/chrome-devtools/console/console-write#styling_console_output_with_css