Reputation: 974
I'm using GWT 2.2.0 and have some tests which only fail in production mode tests (ie. with -prod passed through gwt.args). I can't seem to figure out how to generate debugging output for these tests so I can figure out what is going wrong.
I've tried System.out.println() and also tried using simpleRemoteHandler. However, I've never really used GWT's logging emulation, so I might be doing something wrong, and googling the problem didn't help.
Update 2011-04-26:
I added the following to my gwt.xml file:
<inherits name="com.google.gwt.logging.Logging" />
<set-property name="gwt.logging.logLevel" value="ALL" />
<set-property name="gwt.logging.enabled" value="TRUE" />
<set-property name="gwt.logging.simpleRemoteHandler" value="ENABLED" />
And then tried the following bit of Java in order to log:
Logger logger = Logger.getLogger("");
logger.log(Level.SEVERE, "log message");
However the log message does not seem to appear in any of the test output.
Here is my junit ant configuration:
<junit fork="yes" printsummary="yes" errorproperty="gwttest.runerror.prod">
<jvmarg line="-Xmx256m" />
<sysproperty key="gwt.args" value="-prod -standardsMode -logLevel WARN -war ${dir.build.test.gwttest.war} -out ${dir.build.test.gwttest.out}" />
<sysproperty key="java.awt.headless" value="true" />
<classpath>
<!-- Classes -->
<pathelement location="${junit.jar}" />
<path refid="gwt.classpath" />
<pathelement location="${dir.build.classes}" />
<pathelement location="${dir.build.test.gwttest}" />
<!-- Source -->
<pathelement location="${dir.src.main}" />
<pathelement location="${dir.src.test.base}" />
<pathelement location="${dir.src.test.gwttest}" />
</classpath>
<batchtest todir="${dir.build.reports.gwttest.prod}" >
<fileset dir="${dir.src.test.gwttest}" includes="**/*Test.java" />
</batchtest>
<formatter type="plain" />
<formatter type="xml" />
</junit>
Upvotes: 2
Views: 2199
Reputation: 2092
I've been pretty impressed with the GWT logging emulation. You might want to dig into that and get it working. The gwt-log library should work too, but it's one more dependency to add. Any details you can provide on why logging (in any form) isn't working would help us help you!
Upvotes: 1
Reputation: 80340
Try using gwt-log library. It has several way to log messages in production including <div>
, Firebug console and remote logger (a must when debugging other peoples problems).
Upvotes: 0