• Модуль: vote
  • Путь к файлу: ~/bitrix/modules/vote/lib/base/diag.php
  • Класс: BitrixVoteBaseDiag
  • Вызов: Diag::logDebugInfo
public function logDebugInfo($uniqueId, $label = null)
{
	if($label === null)
	{
		$label = $uniqueId;
	}

	if ($this->enableLog !== true || ($this->exclusiveUserId !== null && $this->getUser()->getId() != $this->exclusiveUserId))
	{
		return;
	}

	Debug::endTimeLabel($uniqueId);
	$timeLabels = Debug::getTimeLabels();

	$debugData = array(
		"Time: {$timeLabels[$uniqueId]['time']}"
	);

	list($prevLabel, $prevLabelCount, $prevSqlTrackerQueries) = array_pop($this->stackSql);
	list($countQueries, $sqlTrackerQueries) = $this->getDebugInfoSql();
	if($countQueries === null)
	{
		$sqlTrackerQueries = array();
		$debugData[] = 'Sql tracker has not been found.';
	}
	else
	{
		if($prevLabel === $uniqueId)
		{
			$countQueries += $prevLabelCount;
			$sqlTrackerQueries = array_merge($prevSqlTrackerQueries, $sqlTrackerQueries);
		}
		$debugData[] = 'Count sql: ' . $countQueries;

	}
	/** @var SqlTrackerQuery[] $sqlTrackerQueries */
	foreach($sqlTrackerQueries as $query)
	{
		$debugData[] = array(
			$query->getTime(),
			$query->getSql(),
			$this->reformatBackTrace($query->getTrace())
		);
		unset($query);
	}

	list($prevLabel, $prevMemoryStart) = array_pop($this->stackMemory);
	if($prevLabel === $uniqueId)
	{
		$debugData[] = 'Memory start: ' . CFile::FormatSize($prevMemoryStart);
		$debugData[] = 'Memory diff: ' . CFile::FormatSize(memory_get_usage(true) - $prevMemoryStart);
	}
	$debugData[] = 'Memory amount: ' . CFile::FormatSize(memory_get_usage(true));
	$debugData[] = 'Memory peak usage: ' . CFile::FormatSize(memory_get_peak_usage(true));
	array_unshift($debugData, "Label: {$label}");
	$this->log($debugData);
}