GWT Logger: No control over debug output?

6 浏览
0 Comments

GWT Logger: No control over debug output?

我在我的client.gwt.xml文件中有以下内容:\n




    
    
    
    
    
    

\n我正在尝试记录以下内容:\n

    LOGGER.info("INFO");
    LOGGER.fine("FINE");
    LOGGER.warning("WARNING");
    LOGGER.severe("SEVERE");

\n但是在我的firebug控制台中只显示SEVERE消息:\n

\n

Mon Sep 07 13:44:09 GMT+200 2015 com.mz.client.App 
SEVERE: SEVERE

\n

\n为什么我没有得到其他日志消息呢?\n


\n我已经在logging.properties中设置了java.util.logging.ConsoleHandler.levelFINE:\n

# Limit the message that are printed on the console to INFO and above.
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

\n


\n编辑:\n现在即使没有其中一行,它也能正常工作\n




\n我删除了这些行,清理了我的项目并启动了Apache服务器,不知何故我收到了调试输出。\n将\n

 

\n更改为\n

 

\n不会改变输出。我收到了所有低于FINER级别的消息。设置\n

 

\n现在也不会删除调试输出。仍然收到所有消息。\n我希望能够控制我的调试输出。

0
0 Comments

GWT Logger: No control over debug output?

问题的原因:在module.gwt.xml文件中,使用了set-property标签设置了gwt.logging.enabled属性为TRUE,但是使用了set-property标签设置gwt.logging.logLevel属性的值为INFO,并没有生效,仍然会打印出FINER和FINE级别的日志信息。

解决方法:根据GWT文档的说明,在module.gwt.xml文件中只使用gwt.logging.logLevel属性即可控制调试输出。不需要使用logging.properties文件。可以参考GWT文档中的最简示例,在module.gwt.xml中继承com.google.gwt.logging.Logging类,并使用gwt.logging.logLevel属性来控制调试输出。

0