title: Temporarily Disable logging for log4net
body: <p>How can I temporarily disable logging of log4net based on the result of my function? 
  example:</p>
  
  <pre><code>if (MyCondition)
  {
  //Stop logging
  }
  else
  {
  //go on, log me...
  }
  </code></pre>
  
  <p>i tried using these codes:</p>
  
  <pre><code> LogManager.GetRepository().Threshold = LogManager.GetRepository().LevelMap["OFF"];
   LogManager.GetRepository().Threshold = LogManager.GetRepository().LevelMap["ALL"];
  </code></pre>
  
  <p>to try to disable log4net logging, but the results are the same. log4net is still logging.</p>
  
  <p>Can this be done? </p>