简体   繁体   中英

Logcat in Android Device Monitor only display certain messages

I am not using Eclipse or Android Studio, I am just compiling my code myself and installing with adb.

If an uncaught exception or error occurs, it prints the the line number of the code that triggered it, but not the message.

If I call Log.d or Log.i, etc. , nothing happens. If I catch an exception and call e.printStackTrace() or System.err.println(), nothing happens.

What could be the issue?

Update: By the way, I am accessing logcat via the Android Device Monitor. Update: It works fine using adb logcat . I just need it to work from Android Device Monitor now.

I think your log level is too high for Log.i and Log.d (for example, if your log level is 'error' you only get error messages)

So set your log level to verbose to display all logs.

You can find the log level indicator in the top right of your Android tab in Android studio

Make sure you don't have any filter set.If you just use the following command you should be able to see all the logs.

adb logcat 

if you want to see only logs with particular tag:

adb logcat -s "TAG" 

Also make sure when you building the apk,you don't have any code that is disabling the logs-because its a release binary.

If you are viewing through IDE logcat view remove the filter.It must be there left hand side corner.If the filter level is error ,you need to make it verbose .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM