我使用parseFile便捷方法来读取css文件,但它产生了大量的警告消息。
我已经设定 validate=False
但它仍在打印消息。
我试图创建一个CSSParser对象并初始化日志对象和日志记录级别为none,但它仍然打印警告和错误。
我查看了源代码,无法看到这些消息的创建位置,因此它可能在parseFile调用的内容中。
有没有办法阻止CSSParser.parseFile()生成如下所示的消息?
WARNING CSSStylesheet: Unknown @rule found. [3:43150:@-webkit-keyframes]
WARNING CSSStylesheet: Unknown @rule found. [3:43329: @-moz-keyframes]
WARNING CSSStylesheet: Unknown @rule found. [3:43496: @keyframes]
WARNING CSSStylesheet: Unknown @rule found. [3:43643: @-webkit-keyframes]
WARNING Property: Unknown Property name. [3:79871: min-device-width]
WARNING Property: Unknown Property name. [3:79900: max-device-width]
ERROR MediaQuery: Unexpected syntax, expected "and" but found "(". [3:86572: (]
ERROR MediaQuery: Unexpected syntax, expected "and" but found ":". [3:86582: :]
ERROR MediaQuery: Unexpected syntax. [3:86583: 35em]
ERROR MediaQuery: Unexpected syntax, expected "and" but found ")". [3:86587: )]
任何帮助将不胜感激!