Can Chrome\'s built-in JavaScript console display colors?
I want errors in red, warnings in orange and console.log
\'s in green. Is that possible?
I actually just found this by accident being curious with what would happen but you can actually use bash colouring flags to set the colour of an output in Chrome:
console.log('\x1b[36m Hello \x1b[34m Colored \x1b[35m World!');
console.log('\x1B[31mHello\x1B[34m World');
console.log('\x1b[43mHighlighted');
Output:
See this link for how colour flags work: https://misc.flogisoft.com/bash/tip_colors_and_formatting
Basically use the \x1b
or \x1B
in place of \e
. eg. \x1b[31m
and all text after that will be switched to the new colour.
I haven't tried this in any other browser though, but thought it worth mentioning.