GEB:如何禁用CSS错误和警告?

时间:2014-09-22 13:05:19

标签: logging groovy log4j geb

我有以下GEB脚本:

@Grapes([
    @Grab(group='org.gebish', module='geb-core', version='0.9.3'),
    @Grab(group='org.seleniumhq.selenium', module='selenium-htmlunit-driver', version='2.42.2'),
    @Grab(group='org.seleniumhq.selenium', module='selenium-support', version='2.42.2'),
    @Grab(group='log4j', module='log4j', version='1.2.17')
])
...
public static void main(String[] args) {
    def config = new ConfigSlurper().parse(new File('log4j.groovy').toURL())
    PropertyConfigurator.configure(config.toProperties())
    Browser browser_ = new Browser()
    ...

以及以下log4j.groovy:

// log4j.groovy
log4j {
    rootLogger="DEBUG, A1"
    appender.A1 = "org.apache.log4j.ConsoleAppender"
    appender.'A1.layout' = "org.apache.log4j.PatternLayout"
    if (System.properties['env'] == 'prod') {
        appender.'A1.layout.ConversionPattern'="prod %-4r [%t] %-5p %c %x - %m%n"
    } else {
        appender.'A1.layout.ConversionPattern'="dev %-4r [%t] %-5p %c %x - %m%n"
    }
    logger.org.apache.http = "fatal"
    logger.com.gargoylesoftware = "fatal"
}

尽管如此,我仍然在stderr上不断收到以下消息:

Sep 22, 2014 4:46:22 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'http://127.0.0.1/www.tatonka.ru/media/css/addons505f.css?t=0612' [93:19] Error in style rule. (Invalid token ":". Was expecting one of: <EOF>, <S>, <NUMBER>, "inherit", <IDENT>, <STRING>, <PLUS>, <COMMA>, <HASH>, <IMPORTANT_SYM>, <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <PERCENTAGE>, <DIMENSION>, <URI>, <FUNCTION>, "}", ";", "/", "-".)
Sep 22, 2014 4:46:22 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning
WARNING: CSS warning: 'http://127.0.0.1/www.tatonka.ru/media/css/addons505f.css?t=0612' [93:19] Ignoring the following declarations in this rule.

请帮我禁用它们!

0 个答案:

没有答案