gpt4 book ai didi

google-chrome - chrome > console.info > 以黑色打印(与 console.log 相同)

转载 作者:行者123 更新时间:2023-12-01 01:46:46 28 4
gpt4 key购买 nike

有没有人遇到这种情况

console.info ('hi');
hi // And this hi is printed in black color as opposed to blue
控制台截图:
https://postimg.org/image/g8isebbrn/

console.info 多年来一直用于打印蓝色!现在令我惊讶的是,不再是了。

我在 chrome 上找不到任何设置,使输出变成这样的色盲!

最佳答案

看起来这是按设计缩进的,去图,但是..这是一种替代方法!
console.log("%cThis will be formatted with large, blue text", "color: blue; font-size: x-large");
不要忘记 %c在那里!

要将其包装在一个函数中,您可以使用以下启动代码:

function sysConsole(messageType,message){ 
if ( messageType === 'info') {
s = '%c' + '##' + messageType + ': ' + message;
// the ## will enable you to do filtering at the console
// by typing ##info
console.log (s, 'color: blue;');
}

// you can have other messageTypes later (to be wired for different colors )

return false;
}

如需 future 灵感,请转至 https://developers.google.com/web/tools/chrome-devtools/console/console-write

关于google-chrome - chrome > console.info > 以黑色打印(与 console.log 相同),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48217179/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com