protected function _logToken($el)
{
switch ($el[self::EN_TYPE]) {
case self::EN_TYPE_STARTTAG:
if ($el[self::EN_FLAGS] & self::EN_FLAGS_CONTENT) {
$spaces = str_repeat(' ', count($this->_logStack));
$this->_logStack[] = $el[self::EN_TAG];
$this->_logger->debug(sprintf('[%s] I %s <%s>', $this->_procid, $spaces, $el[self::EN_TAG]));
} else {
$spaces = str_repeat(' ', count($this->_logStack));
$this->_logger->debug(sprintf('[%s] I %s <%s />', $this->_procid, $spaces, $el[self::EN_TAG]));
}
break;
case self::EN_TYPE_ENDTAG:
$tag = array_pop($this->_logStack);
$spaces = str_repeat(' ', count($this->_logStack));
$this->_logger->debug(sprintf('[%s] I %s </%s>', $this->_procid, $spaces, $tag));
break;
case self::EN_TYPE_CONTENT:
$spaces = str_repeat(' ', count($this->_logStack) + 1);
if ($this->_logLevel == self::LOG_PROTOCOL && ($l = Horde_String::length($el[self::EN_CONTENT])) > self::LOG_MAXCONTENT) {
$this->_logger->debug(sprintf('[%s] I %s %s', $this->_procid, $spaces, sprintf('[%d bytes of content]', $l)));
} else {
$this->_logger->debug(sprintf('[%s] I %s %s', $this->_procid, $spaces, $el[self::EN_CONTENT]));
}
break;
}
}