System.out.println and logging
For existing Java users, coding Android using the Eclipse IDE will surprise many first timers. Why? Because the System.out.println() does not show anything in the console. But do not fret, there is a way and it is just not in the console.
There is another console called LogCat and this is what you need to enable in order for you to view console output. Go to Alt + 6
Then you use the Log class in order to send out messages to the LogCat console. The Log class has actually a few methods to distinguish what kind of message it sends out to the console. Check them out below.
Log.v (for verbose) Log.d (for debug) Log.i (for info) Log.w (for warnings) Log.e (for errors)
To use the Log class, do this. It takes in two parameters: TAG is useful to indicate where the message originated.
Log.v(TAG, messagestring);
The screenshot below came from these two lines of code
import android.util.Log; // need this to use log .....
System.out.println("[ConfigLoginUI] constructor()");
Log.v("ConfigLoginUI", "constructor()");
Notice that I was still able to output using System.out.println() but the the Log class is much more useful for me because it is easier for me to dissect which class the output came from.
Another useful log window ---event log window
View-> Tool Windows ->EventLog