如何改变chrome console输出信息颜色
方法一:在css文件中定义样式
在C:\Users\<user name>\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets\Custom.css 文件中定义样式
例如:
.console-error-level .console-message-text{
color: red;
}
.console-warning-level .console-message-text {
color: orange;
}
.console-log-level .console-message-text {
color:green;
}
方法二:使用代码定义样式
console.log('%c Oh my heavens! ', 'background: #222; color: #bada55', 'more text');
参考chrome console API https://developers.google.com/chrome-developer-tools/docs/console-api?hl=zh-CN#consolelogobject_object
相关推荐
86417413 2020-11-25
simonzhao0 2020-11-23
zytyxz 2020-10-28
HappyBlog 2020-10-27
爱读书的旅行者 2020-10-26
del 2020-10-21
WenSenli 2020-10-12
ChromeDisaster 2020-10-11
svap 2020-08-25
simonzhao0 2020-08-17
shayuchaor 2020-08-17
yidaizongshi 2020-08-16
化风 2020-08-14
tiankele0 2020-07-29
maowenbei 2020-07-19
curiousL 2020-07-18
王练 2020-07-18
liuweiq 2020-07-08