• Модуль: scale
  • Путь к файлу: ~/bitrix/modules/scale/lib/action.php
  • Класс: BitrixScaleAction
  • Вызов: Action::makeLogRecords
protected function makeLogRecords($command = "", $result = null, $output = "", $error = "")
{
	if($command <> '')
	{
		//cut password data from log records
		$preg = "/(-p.*s+|--mysql_password=.*s+|--cluster_password=.*s+|--replica_password=.*s+|--password=.*s+)/is";
		$command = preg_replace($preg, ' PASS_PARAMS ', $command);

		$this->log(
			($result ? Logger::LOG_LEVEL_INFO : Logger::LOG_LEVEL_ERROR),
			"SCALE_ACTION_STARTED",
			$this->actionParams["NAME"],
			$command
		);
	}

	if($result !== null)
	{
		$this->log(
			($result ? Logger::LOG_LEVEL_INFO : Logger::LOG_LEVEL_ERROR),
			"SCALE_ACTION_RESULT",
			$this->actionParams["NAME"],
			$result ? Loc::getMessage("SCALE_ACTION_RESULT_SUCCESS") : Loc::getMessage("SCALE_ACTION_RESULT_ERROR")
		);
	}

	if($output <> '')
	{
		$this->log(
			Logger::LOG_LEVEL_DEBUG,
			"SCALE_ACTION_OUTPUT",
			$this->actionParams["NAME"],
			$output
		);
	}

	if($error <> '')
	{
		$this->log(
			Logger::LOG_LEVEL_ERROR,
			"SCALE_ACTION_ERROR",
			$this->actionParams["NAME"],
			$error
		);
	}
}