title: best way to check logs after Makefile command
body: <p>One of my projects' Makefile runs a bunch of tests on a headless browser for the functional test step. Most of the test is for the front-end code, but i also check for any error/warning on the backend. </p>
  
  <p>Currently, we are cleaning the web server log, running all the (very slow) tests, and then grepping the server log for any error or warning.</p>
  
  <p>i was wondering if there was any way to have a listener parsing the log (e.g. <code>tail -f | grep</code>) starting on the background, and kill the make target if it detects any error/warning during the test run.</p>
  
  <p>what i got so far was</p>
  
  <ol>
  <li>start long lived grep in the background and store PID.</li>
  <li>run tests.</li>
  <li>check output of long lived grep</li>
  <li>kill PID.</li>
  <li>in case of any error, fail.</li>
  </ol>
  
  <p>This only bought me the advantage that now i do not lose the server logs on my dev box every time, as i do not have to clean it every time. But i still have to wait a long time (minutes) for a failure that may have occurred in the very first one.</p>
  
  <p>is there any solution for it?</p>