code: public function onLog(Event $event)
      {
          $this->channelName = $this->debug->parentInstance
              ? $event['meta']['channel'] // just clear this specific channel
              : null;
          $this->channelRegex = '#^'.\preg_quote($this->channelName, '#').'(\.|$)#';
          $this->isRootInstance = $this->debug->rootInstance === $this->debug;
          $bitmask = $event['meta']['bitmask'];
          $callerInfo = $this->debug->utilities->getCallerInfo();
          $cleared = array();
          $cleared[] = $this->clearAlerts($bitmask);
          $cleared[] = $this->clearLog($bitmask);
          $cleared[] = $this->clearSummary($bitmask);
          $this->clearErrors($bitmask);
          if (($bitmask & Debug::CLEAR_ALL) === Debug::CLEAR_ALL) {
              $cleared = array('everything');
          }
          $args = $this->getLogArgs($cleared);
          $event->setValues(array(
              'method' => 'clear',
              'args' => $args,
              'meta' =>  \array_merge(array(
                  'file' => $callerInfo['file'],
                  'line' => $callerInfo['line'],
                  'bitmask' => $bitmask,
                  'flags' => array(
                      'alerts' => (bool) ($bitmask & Debug::CLEAR_ALERTS),
                      'log' => (bool) ($bitmask & Debug::CLEAR_LOG),
                      'logErrors' => (bool) ($bitmask & Debug::CLEAR_LOG_ERRORS),
                      'summary' => (bool) ($bitmask & Debug::CLEAR_SUMMARY),
                      'summaryErrors' => (bool) ($bitmask & Debug::CLEAR_SUMMARY_ERRORS),
                      'silent' =>  (bool) ($bitmask & Debug::CLEAR_SILENT),
                  ),
              ), $event['meta']),
              'log' => $args && !($bitmask & Debug::CLEAR_SILENT),
              'publish' => (bool) $args,
          ));
          return $event;
      }
docs: Handle clear() call
  
  @param Event $event event object
  
  @return Event