User Tools

Site Tools


android_learning:using_the_system_log

This is an old revision of the document!


Using the system log

You can use the system log to output debug information to the console. Log.d(tag, message) lets you output anything you want to the console. Example:

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

You have to import import android.util.Log to use Log.d.

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.1461468857.txt.gz · Last modified: 2016/04/24 03:34 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki