When I write messages to log (i.e. com.allen_sauer.gwt.log.client.Log#debug
) I can see them in Chrome->F12->Console or (during debug) in IDEA->Debug->Dev Mode. But if the System.out.println()
was used in IDEA the messages appear in the same place as the logged ones, but what about when I am not debugging? where do they go?
Asked
Active
Viewed 4,010 times
5

niralittle
- 114
- 1
- 3
- 9
2 Answers
5
System.out.println()
are just removed by the compiler in production mode.
If you want to check just create this simple module:
public class Foo implements EntryPoint {
public void onModuleLoad() {
System.out.println("Hello World!");
}
}
And look at the generated javascript.

StephaneM
- 4,779
- 1
- 16
- 33
-
What about in Super Dev Mode? What happens to them then? – Dessa Simpson Apr 15 '17 at 19:35
2
The preferred way to do logging (at development time) is com.google.gwt.core.client.GWT.log()
. Messages logged this way will also wind up in your browser's console like you mention. Likely System.out.println
is mapped to the same functionality for convenience. From the GWT.log
Javadoc:
Logs a message to the development shell logger in Development Mode, or to the console in Super Dev Mode. Calls are optimized out in Production Mode.

geert3
- 7,086
- 1
- 33
- 49
-
2Also consider the juli logging: http://www.gwtproject.org/doc/latest/DevGuideLogging.html – Colin Alworth Feb 04 '15 at 14:35