title: My app's logcat output keep disappearing due to other unwanted outputs flooding logcat
body: <p>While developing my app on a Moto G, I often encounter tens of thousands of below messages flooding the log.</p>
  
  <pre><code>E/MM_OSAL (  275): isSamePayload Sync byte(0x47) not found!! m_nCurrOffset=0
  E/MM_OSAL (  275): isSamePayload Sync byte(0x47) not found!! m_nCurrOffset=0
  ... repeated 20000 times in a span of 12 secs
  D/WifiStateMachine(1004): processMsg: L2ConnectedState
  D/WifiStateMachine(1004): handleMessage: X
  D/WifiStateMachine(1004): handleMessage: E msg.what=131155
  ... repeated 15000+ times all interspersed together
  </code></pre>
  
  <p>Now, of course I have set Logcat filters but all these messages are filling up the logcat buffer and my own debug messages keep disappearing.</p>
  
  <p>Observations</p>
  
  <ul>
  <li>This happens irrespective of using Android Studio or Eclipse. This means the issue is with Logcat and not how the IDE handles it I suppose.</li>
  <li>According to <a href="https://stackoverflow.com/questions/15542393/logcat-messages-disappear-after-a-short-time">this question</a>, I am supposed to increase the default logcat buffer size or set it to infinite (0), but this still does not solve due to the sheer rate at which these spams keep piling up.</li>
  <li>If I reboot the phone, it clears up the logcat only for a few minutes before the spams catch up.</li>
  </ul>
  
  <p>How do I stop these unwanted messages from overflowing Logcat buffers?</p>
  
  <p><strong>Update:</strong> Okay I think I have found some clue. The logcat buffer is not getting cleared</p>
  
  <pre><code>$ ./adb logcat -g
  /dev/log/main: ring buffer is 256Kb (255Kb consumed), max entry is 5120b, max payload is 4076b
  /dev/log/system: ring buffer is 256Kb (0Kb consumed), max entry is 5120b, max payload is 4076b
  $ ./adb logcat -c
  $ ./adb logcat -g
  /dev/log/main: ring buffer is 256Kb (255Kb consumed), max entry is 5120b, max payload is 4076b
  /dev/log/system: ring buffer is 256Kb (0Kb consumed), max entry is 5120b, max payload is 4076b
  </code></pre>
  
  <p>As you can see, the <code>main</code> buffer is not getting cleared - maybe that's the reason my app's messages are not making it to logcat.</p>