Print a log message to the console in GWTTestCase

I would like to debug some of my GWTTestCase, and print logging messages would probably be the easiest way to do this. Is there any way to do this?

+3
source share
4 answers

If you run the test in DevMode (i.e. you did not pass -web or -prod to JUnitShell), you can use System.out.println()for some protocols with bare bones.

+3
source

Use the standard GWT logging mechanism as described here: http://code.google.com/webtoolkit/doc/latest/DevGuideLogging.html

This is java.util.logging emulation, so you can call it on the client, shared or server, and everything will work.

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

.

+1
private static Logger logger = Logger.getLogger("");
...
logger.log(Level.INFO, "Some stuff");
0
source

Source: https://habr.com/ru/post/1790217/


All Articles