Logging in Android Studio

  • Replies:2
  • OpenNot stickiedUnanswered
  • Forum posts: 9

Nov 17, 2018, 1:50:01 PM via Website


How can I use the logging facility in Android Studio for debug purpose? I tried using the Log.d() feature but nothing seems to log. Thanks

  • Forum posts: 1,286

Nov 17, 2018, 3:39:28 PM via Website

To display the LogCat in Android Studio, from the Main menu select View>Tool Buttons to display the tool buttons at the bottom-left of the screen. Click on 6: Android to display the LogCat.

Download size < 0.07 MB. But also Accurate, Ad-Free & Full-Free.
The minimalist app available on Google Play https://goo.gl/ws42fN
Your 5-star is appreciated. Blog : https://okblackcafe.blogspot.com

  • Forum posts: 4

Dec 7, 2018, 10:58:49 AM via Website

Hello Sures,
By using Log.d() you write the output to the Logcat file which you can open at the bottom of Android Studio.
To make a better job, you should set, at the beginning of every class you want to log, a TAG constant containing the name of the class itself, then log into the Logcat in this way: Log.v(TAG, "text to be logged"). This way you will be able to filter the logs.
The different Logcat methods are:
Log.v(); // Verbose
Log.d(); // Debug
Log.i(); // Info
Log.w(); // Warning
Log.e(); // Error

Have a nice day.

Recommended by NextPit