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.
Asked
Active
Viewed 667 times
0
-
1Try 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 Answers
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: