Colors in JavaScript console

前端 未结 27 2231
说谎
说谎 2020-11-22 11:42

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?

27条回答
  •  难免孤独
    2020-11-22 12:10

    You can use a custom stylesheet to color your debugger. You can put this code in C:\Documents and Settings\\Local Settings\Application Data\Google\Chrome\User Data\Default\User StyleSheets\Custom.css if you are in WinXP, but the directory varies by OS.

    .console-error-level .console-message-text{
        color: red;
    }
    
    .console-warning-level .console-message-text {
        color: orange;
    }
    
    .console-log-level .console-message-text {
        color:green;
    }
    

提交回复
热议问题