Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do System.out.println() messages go, when it is called in client-side GWT-module?

Tags:

java

println

gwt

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?

like image 895
niralittle Avatar asked Feb 04 '15 13:02

niralittle


People also ask

Where does system out Println go?

out. println does not print to the console, it prints to the standard output stream ( System. out is Java's name of the standard output stream). The standard output stream is usually the console, but it doesn't have to be.

How does system out Println work?

The println() method is similar to print() method except that it moves the cursor to the next line after printing the result. It is used when you want the result in two separate lines. It is called with "out" object. If we want the result in two separate lines, then we should use the println() method.

What is GWT client?

GWT contains a number of HTTP client classes that simplify making custom HTTP requests to your server and optionally processing a JSON- or XML-formatted response. GWT contains a set of HTTP client classes that allow your application to make generic HTTP requests.

How do I see GWT logs?

Logs by calling method GWT. log. These messages can only be seen in Development Mode in the DevMode window. Logs to the javascript console, which is used by Firebug Lite (for IE), Safari and Chrome.


1 Answers

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.

like image 148
StephaneM Avatar answered Oct 03 '22 00:10

StephaneM