Use the Android logging utility.
http://developer.android.com/reference/android/util/Log.html
The log has a bunch of static methods for accessing different levels of the log. A common thread is that they always accept at least a tag and a log message.
Tags are a way to filter the output in your log messages. You can use them to make your way through the thousands of log messages that you see and find the ones you are specifically looking for.
You use the log features in Android by accessing Log.x objects (where method x is the log level). For example:
Log.d("MyTagGoesHere", "This is my log message at the debug level here"); Log.e("MyTagGoesHere", "This is my log message at the error level here");
I usually do this to make the tag my class name so that I know where the log message was created. Saves a lot of time later in the game.
You can view your log messages using the logcat tool for Android:
adb logcat
Or by opening the Logcat eclipse view by going to the menu bar
Window->Show View->Other then select the Android menu and the LogCat view
John O'Connor Nov 18 2018-11-11T00: 00Z
source share