7

When I start debugging my App in Android Studio 3.0 and open the Logcat, it displays so many messages and warnings, but the problem is, it never stops, even when the debugging is completed and the App is terminated, it still prints so many messages continuously. Can anybody help???

Phantômaxx
  • 36,442
  • 21
  • 78
  • 108
geekFromPeshawar
  • 171
  • 1
  • 13
  • 2
    Try to filter logcat to show only messages from your application: https://stackoverflow.com/questions/19931987/how-to-filter-logcat-in-android-studiodroid – pleft Nov 27 '17 at 08:28
  • 1
    If those logs are not coming from your app then I say it is normal. – Enzokie Nov 27 '17 at 08:32

3 Answers3

17

Since you are not debugging or running any application on the device you have connected. Hence, the logcat is displaying the logs generated by all the apps in the device as well as the system logs. Which makes the log cat window go nuts.

What you can do is. On the top right corner of the log cat window, there is a filter config combo box. Select or create a filter of your own to filter out relevant logs. enter image description here

enter image description here

The filter could be created using any details, it could be a process ID (PID), the tag name e.g I/ActivityManager: where I stands for Info, V for Verbose, D for Debug and so on.

Slimane amiar
  • 733
  • 9
  • 24
Kshitij
  • 372
  • 1
  • 12
  • 1
    I am just still amazed that one has to create a filter. The problem with creating a filter, you may miss some messages that you don't expect, such as exception from your app etc. Is it really hard, for google, to create a logging tool, that just shows me messages from my app, only my app by default. And then if I want some other garbage, i can go into settings and enable that? Because when logcat fills up now, sometimes it chokes, it doesn't show anything, or it takes really a long time to show results. smh. – TatiOverflow Feb 22 '18 at 19:31
  • thanks it is really helpful to me. In Package Name, i pass my application package name after that it is showing application log only – Mohammed Nishar Sep 15 '18 at 19:58
1

You can add filter in your Logcat, and mention all the classes whose logs you want to discard.

In the field LogTag (shown in the pic) define a regex like this ^(?!Class A | Class B|#). Here Class A and Class B are the classes whose logs you don't want to see.That's it.log cat

Ezio
  • 2,367
  • 1
  • 21
  • 33
  • 1
    Like i've been saying, why is this really required. Can't google just create a tool that shows messages from my app without bothering with filters? Because this filter might miss some messages that i really want to see. Then you end up playing with filters here and there, which is really messy. – TatiOverflow Feb 22 '18 at 19:35
  • Well right now there is no such tool, so we have to work with what we have at our disposable. And yes there is definitely a chance where you can miss some messages. But I use this to filter out those messages which are irrelevant and fill up the logcat like ConnectivityManager, DeviceThreaad etc. If you have a better way, do share it with us. – Ezio Feb 23 '18 at 04:50
  • I have realized that by selecting the debugging process does a good job. Not great, but good. – TatiOverflow Feb 23 '18 at 23:40
1

If you see no debuggable application then change it to your app name. If that wont help change the log level to error. Last thing you can try is to filter the results. Good luck!

Marcin K.
  • 94
  • 2
  • 10