title: How to monitor logcat within android application and fire event
body: <p>How do you continuously monitor the logcat output and fire an event when a certain log is detected?</p>
  
  <p>In my case, I only care about NfcService tags, and I want to trigger an event if the text of a logcat matches something I am looking for.</p>
  
  <p>Is there an easy way to do this? Do I have to execute logcat every second and look for the string, or is there a way that I can have it constantly monitoring the logcat output?</p>
  
  <p>Example code would be appreciated.</p>
  
  <p>Thank you.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>@AedonEtLIRA If there is another better way to do this, I would do it. The problem I am having is that the NFC service crashes when too many NFC chips are read at a time. I am able to disable and enable the NFC service using a button in my application, but I want to be notified when the NFC service crashes so I can programatically automatically restart the service. The only way I could think of is to monitor the logcat output. If there is a better way please let me know.</p>