Philippe Beaudoin
Philippe Beaudoin

Reputation: 3310

Printing a logging message to the console in a GWTTestCase

I'd like to debug some of my GWTTestCase and printing logging messages would probably be the easiest way to do it. Is there any way to do that?

Upvotes: 4

Views: 2947

Answers (4)

Jaroslav Záruba
Jaroslav Záruba

Reputation: 4876

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

Upvotes: -1

Andrew Mackenzie
Andrew Mackenzie

Reputation: 5737

Either use the standard GWT Logging mechanism as described here: http://code.google.com/webtoolkit/doc/latest/DevGuideLogging.html

That is an emulation of java.util.logging so you can call it on client, shared or server code and will all work.

Or, there is also the excellent gwt-log GWT library here: http://code.google.com/p/gwt-log/

Which is easy to add to your project.

Upvotes: 1

BobV
BobV

Reputation: 4173

If you're running the test in DevMode (i.e. you didn't pass -web or -prod to the JUnitShell) you can use System.out.println() for some bare-bones logging.

Upvotes: 3

maneesh
maneesh

Reputation: 1701

Have you checked out http://code.google.com/webtoolkit/doc/latest/DevGuideLogging.html

Upvotes: 0

Related Questions