A
A
Anton Akimov2016-12-20 21:10:29
Android
Anton Akimov, 2016-12-20 21:10:29

Why might Log.d(...) not work when working with an Android device?

I'm writing an app in Android Studio and testing and debugging it on several different devices. In the right places in the code, I call the Log.d(…) method, i.e. the application should periodically write something to the log.
On most devices, everything works as it should - in logcat I see my logs. But on 2 devices my logs are not displayed. System logs are present, but mine are not.
I set up filters in different ways, reconnected and restarted everything that was possible, debugging on devices is allowed. Google and StackOverflow don't help. Devices - smartphones with Android 6.0 or 4.4.
Any ideas what could be the problem?
UPD:Found out that only DEBUG or VERBOSE level logs are not displayed. If you call the Log.e() or Log.i() methods, then everything works. I tried to force the logging level (as indicated in the documentation ) in the terminal:
$ setprop log.tag.myTag DEBUG
and in the code: but the result does not change.
System.setProperty("log.tag.myTag", "DEBUG");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Akimov, 2019-05-08
@antaki93

This is some kind of garbage in the smartphones themselves. I use Log.i() everywhere and don't worry.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question