I observed that when i use Logcat with Eclipse with ADT for Android, I get messages from many other applications as well. Is there a way to filter this and show only messages from my own application only.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Package names are guaranteed to be unique so you can use the
Logfunction with the tag as your package name and then filter by package name:NOTE: As of Build Tools 21.0.3 this will no longer work as TAGS are restricted to 23 characters or less.
Log.<log level>("<your package name>", "message");adb -d logcat <your package name>:<log level> *:S-ddenotes an actual device and-edenotes an emulator. If there’s more than 1 emulator running you can use-s emulator-<emulator number>(eg,-s emulator-5558)Example:
adb -d logcat com.example.example:I *:SOr if you are using
System.out.printto send messages to the log you can useadb -d logcat System.out:I *:Sto show only calls to System.out.You can find all the log levels and more info here: https://developer.android.com/studio/command-line/logcat.html
http://developer.android.com/reference/android/util/Log.html
EDIT: Looks like I jumped the gun a little and just realized you were asking about logcat in Eclipse. What I posted above is for using logcat through adb from the command line. I’m not sure if the same filters transfer over into Eclipse.