title: How does one turn off logging during unit testing in CakePHP 2.x?
body: <p>If you are unit testing a model, for instance, and in that model you use CakePHP's CakeLog convenience method (perhaps testing an expected exception, etc):</p>
  
  <pre><code>CakeLog::warning('This is a warning');
  </code></pre>
  
  <p>Cake will not only output this at the command line during your test, it will also add the error to logs/error.log.  </p>
  
  <p>I need to accomplish one of two things:</p>
  
  <ol>
  <li>Turn off logging during unit testing</li>
  <li>Mock the CakeLog class or stub Model->log() (inherited from Object->log)</li>
  </ol>
  
  <p>How does a savvy CakePHP developer accomplish one of these two things?</p>
  
  <p>Related: <a href="https://stackoverflow.com/questions/9952001/cakephp-logging-to-live-db-during-unit-testing">Using DB logging and doing said logging to your test database where such a thing wouldn't bother you...</a></p>