Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happened with the (i) icon for console.info()?

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:

Output from console.info()

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?

like image 382
marlar Avatar asked Mar 15 '18 09:03

marlar


1 Answers

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 :)

like image 53
Veverke Avatar answered Sep 20 '22 03:09

Veverke