I noticed that console.info() no longer shows an (i) icon to the left of the line. There is no difference between console.info() and console.log().
On 49.0.2623.112 (on XP) it looks like this:
My current version is 64.0.3282.140 but I think the icon has been gone for a while.
Is there some setting to get the icon back?
Josh Lee's link suggest the following workaround:
console.log("%ci%c Hello", "color: white; background: blue;", "");
Elaborating on that, one can have
function logInfo(text, bgColor, color) {
console.log(`%c${text}`, `color: ${color}; background: ${bgColor};`);
}
logInfo('test 1', 'orange', 'black');
logInfo('test 2', 'white', 'green');
logInfo('test 3', 'green', 'white');
This actually gives us more flexibility - and one can customize his own special output types.
In a short: would chrome not have removed the feature, I would not learn about this :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With