Can't turn off HtmlUnit logging messages

后端 未结 7 2063
悲哀的现实
悲哀的现实 2020-12-28 08:50

I\'m using HtmlUnit to interact with a web page that interacts with the server via Ajax. Soon after the Ajax code starts, HtmlUnit produces these two log messages:

7条回答
  •  清酒与你
    2020-12-28 09:04

    I am using Htmlunit 2.13, and following code is working to trunoff warnings.

    LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog");
    java.util.logging.Logger.getLogger("com.gargoylesoftware.htmlunit").setLevel(Level.OFF);
    java.util.logging.Logger.getLogger("org.apache.commons.httpclient").setLevel(Level.OFF);
    

提交回复
热议问题