User Tools

Site Tools


android_learning:using_the_system_log

Using the system log

Log.d(tag, message) lets you output anything you want to the console when you run the app in debug mode. You have to import android.util.Log to use Log.d.

Example:

Log.d("MyMessages", "Hello, world.");

In Android Studio, when you run your app in debug mode (Run > Debug 'app' or the bug icon in the toolbar or Shift+F9) you should see a new pane on the bottom panel: 6: Android monitor. Your messages will show up there—along with a bunch of others.

You can filter out everything except what you have tagged with your tag by selecting “Edit filter configuration” from dropdown at the far right of the 6: Android monitor pane and adding your tag to the “Log Tag” field. You may have to uncheck the “Regex” box.

For more info, see Debugging with Android Studio at the Android Developers site.

android_learning/using_the_system_log.txt · Last modified: 2016/04/24 04:13 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki