开发者

Loggers in GWT Client Side

开发者_开发百科Is there a way to report log messages in a Client-side GWT applications for development purposes (in Standard GWT libraries i.e. No external libraries)?

i.e. like the Logger that can be used to output log messages to catalina.out when developing things for say Tomcat.


Take a look to the gwt-log project. Seems that's you're looking for.

http://code.google.com/p/gwt-log/


Just a quick example..

Add this line in *.gwt.xml file. Its in parent package of your client side source. The top most package..

<inherits name="com.google.gwt.logging.Logging"/>

Add this in .java file, lets say in the onModuleLoad() method

public void onModuleLoad() {
  Logger logger = Logger.getLogger("NameOfYourLogger");
    logger.log(Level.SEVERE, "this message should get logged");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜