Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable D/libc from logging network information into logcat?

I am getting a lot of debugging log in my Android logcat like this:

10-16 17:21:38.422  22842-23270/package D/libc﹕ [NET] getaddrinfo+,hn 23(0x696d616765732e),sn(),family 0,flags 4
10-16 17:21:38.422  22842-23270/package D/libc﹕ [NET] getaddrinfo-,err=8
10-16 17:21:38.422  22842-23270/package D/libc﹕ [NET] getaddrinfo+,hn 23(0x696d616765732e),sn(),family 0,flags 1024
10-16 17:21:38.422  22842-23270/package D/libc﹕ [NET] getaddrinfo-, 1
10-16 17:21:38.422  22842-23270/package D/libc﹕ [NET] getaddrinfo_proxy+
10-16 17:21:38.432  22842-23270/package D/libc﹕ [NET] getaddrinfo_proxy-, success

I am not sure where they come from because I did not have such tag in my codes, but they are clearly related to network activities.

like image 339
paradite Avatar asked Oct 16 '14 09:10

paradite


People also ask

What does Logcat D do?

Logcat is a command-line tool that dumps a log of system messages, including stack traces when the device throws an error and messages that you have written from your app with the Log class. This page is about the command-line logcat tool, but you can also view log messages from the Logcat window in Android Studio.

How do I turn off log on Android?

Turn off logging and debugging You can disable debugging by removing the android:debuggable attribute from the <application> tag in your manifest file, or by setting the android:debuggable attribute to false in your manifest file. Also, remove any log files or static test files that were created in your project.

How do I stop ADB logs?

-c Clears (flushes) the entire log and exits. Thank you, it's really helped me.


1 Answers

You can add ^(?!(libc)) in a logcat filter

1) Create logcat filter Add filter

2) Apply regex apply regex

You can also remove differents tags by adding tag's name seperate by | in the regex.

Example : ^(?!(libc|tagname2|tagname3|...))

like image 55
Octopus38 Avatar answered Oct 07 '22 16:10

Octopus38