0

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.

Zoe
  • 27,060
  • 21
  • 118
  • 148
rostamiani
  • 2,859
  • 7
  • 38
  • 74
  • 1
    Try filtering your log. See this answer [How to filter logcat in Android Studio?] [1]: http://stackoverflow.com/questions/19931987/how-to-filter-logcat-in-android-studio – Emil Jun 24 '15 at 06:25

2 Answers2

2

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));
}
Khushal Chouhan
  • 581
  • 5
  • 15
1

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?

Community
  • 1
  • 1
BrentM
  • 5,671
  • 3
  • 31
  • 38