code: private function clearLogHelper(&$log, $clearErrors = false, $entriesKeep = array())
      {
          $keep = $clearErrors
              ? array()
              : array('error','warn');
          if ($keep || $this->channelName) {
              // we need to go through and filter based on method and/or channel
              foreach ($log as $k => $entry) {
                  $channel = isset($entry[2]['channel']) ? $entry[2]['channel'] : null;
                  $channelMatch = !$this->channelName || $channel === $this->channelName;
                  if (\in_array($entry[0], $keep) || !$channelMatch) {
                      $entriesKeep[$k] = $entry;
                  }
              }
          }
          \ksort($entriesKeep);
          $log = \array_values($entriesKeep);
      }
docs: [clearLogHelper description]
  
  @param array   $log         log to clear (passed by reference)
  @param boolean $clearErrors whether or not to clear errors
  @param array   $entriesKeep log entries to keep
  
  @return void