Where can I print out logs to see immediately in Android Studio?

761 views Asked by At

I'm using Android studio and want to print out errors and warnings to somewhere like console for debugging. How can I do this? I know Logcat, but there is always full of logs and I cannot find mine.

2

There are 2 answers

2
Khushal Chouhan On BEST ANSWER

Use error log to print your stacktrace. Error log has less messages and you can easily find out your message. If you are using try/catch block:

try
{
    //your code
}
catch(Exception e)
{    
Log.e("error tag", Log.getStackTraceString(e));
}
0
BrentM On

Logcat is the way to go. It is possible to filter logcat based on just the output coming from your application, or just a specific tag to make it easier to see the output you want.

Take a look here for details about how to filter logcat in Android Studio:

How to filter logcat in Android Studio?