qt添加控制台语句
I was recently checking out Google Plus because they implement some awesome effects. I opened the console and same the following message:
我最近正在检查Google Plus,因为它们实现了一些很棒的效果。 我打开了控制台,并显示以下消息:
WARNING!
警告!
Using this console may allow attackers to impersonate you and steal your information using an attack called Self-XSS.
使用此控制台,攻击者可能使用称为Self-XSS的攻击来冒充您并窃取您的信息。
Do not enter or paste code that you do not understand.
不要输入或粘贴您不理解的代码。
View Demo 观看演示I wasn't surprised to see that message but what I did notice was that the text was red and the background was yellow. The text was even a bit bigger. How did they do it? Pretty easily:
看到该消息并不令我感到惊讶,但我确实注意到文本为红色,背景为黄色。 文本甚至更大。 他们是如何做到的呢? 很容易:
console.log("%c%s", "color: red; background: yellow; font-size: 24px;", "WARNING!");The first argument is the order of style and message, the second is the style set, and the last is the desired message.
第一个参数是样式和消息的顺序,第二个参数是样式集,最后一个是所需的消息。
View Demo 观看演示As to why you'd want to use this? If it helps you identify debug information easier in the console, you may consider calling more attention to some messages!
至于为什么要使用这个? 如果它有助于您在控制台中更轻松地识别调试信息,则可以考虑引起更多注意!
翻译自: https://davidwalsh.name/add-styles-console
qt添加控制台语句
相关资源:jdk-8u281-windows-x64.exe