Use the system log to output debug information (Associate Android Developer Certification)

This is example how you can use Log class to show logs.

public class MainActivity extends AppCompatActivity {

    final String LOG_TAG = "LogSandboxTag";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Log.e(LOG_TAG, "This is error");
        Log.w(LOG_TAG, "This is warning");
        Log.i(LOG_TAG, "This is info");
        Log.d(LOG_TAG, "This is debug");
        Log.v(LOG_TAG, "This is verbose");
        Log.wtf(LOG_TAG, "What a Terrible Failure!");

    }
}

If you want to hide logs when release, you can do this in gradle.build(app)

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField "boolean", "USE_LOG", "false"
        }
        debug {
            buildConfigField "boolean", "USE_LOG", "true"
        }
        // Release with logs is inherited from release
        releaseWithLog.initWith(buildTypes.release)
        releaseWithLog {
            buildConfigField "boolean", "USE_LOG", "true"
        }
    }

If you want to show log in device use library called Galgo.