Why are Log.d() and Log.v() not printing

旧时模样 提交于 2019-11-28 10:41:55

Android Studio filters lines that have already been logged but Log itself may filter some levels when logging. See Log.isLoggable:

The default level of any tag is set to INFO.

(However on many phone it is actually set to DEBUG or VERBOSE.)

Yogesh Rathi

Accepted answer not working

My solution:

when your Log.d is not working then Log.wtf is work

It's working for me, may be this is helpful to other, who find solution

Fortran

Fix For meizu phone

Settings -> Accessibility -> Developer options -> advanced logging->set "Allow all"

For Meizu MX4(Flyme 6.1.0.0), M2(Flyme 6.1.0.0G), M5(Flyme 6.3.0.0G) :

Settings->Accessibility - > Developer Options -> Performance optimization -> Advanced logging -> set "Allow all"

Huawei, logcat not showing the log for my app?

For other phone search in "developers options": option "logging" and set "all".

I was trying everything. From log.d to log.wtf. But nothing worked.

Then I restarted my Android Studio. After that, the debugger started working again.

Hope this helps to someone.

Turn off your Developer Option then Restart Your Phone After that on developer option It definitely works by sure!!

I've faced also to the same issue. Even following the previous answers, I didn't find the way to show logs in the Logcat.

After many tries done on my own, here is the (other) way to get logs shown:

Just selecting "Show only selected application" in the combobox did the job. Priorly, it was "Firebase" which was selected.

Hopefully, you will see your logs ;-)

For me the issue was that I had actually disabled the logger buffer in my developer settings so go to Settings -> Developer options -> Logger buffer size and set it to anything that isn't 'off'.

This started happening with me in Android Studio 3. I was getting old Log.v's printing, but when I added a new one nothing happened. Ditto with debugger breakpoints.

Cleaning the solution and restarting Android Studio worked for me, but there was a simpler solution.

Disable Instant Run. It seems that Instant Run doesn't recognise new Log.v's or breakpoints.

Along the way I also added Gradle-aware Make to my Run/Debug configuration for the main activity. I don't know whether that was necessary, but I'm keeping it. ([Main Menu] Run -> Edit Configurations...)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!