• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/diag/logformatter.php
  • Класс: BitrixMainDiagLogFormatter
  • Вызов: LogFormatter::format
public function format($message, array $context = []): string
{
	// Implementors MAY have special handling for the passed objects. If that is not the case, implementors MUST cast it to a string.
	$message = $this->castToString($message);

	if (!isset($context['delimiter']))
	{
		$context['delimiter'] = static::DELIMITER;
	}

	// Placeholder names MUST be delimited with a single opening brace { and a single closing brace }. There MUST NOT be any whitespace between the delimiters and the placeholder name.
	$replace = [];
	foreach ($context as $key => $val)
	{
		$replace['{' . $key . '}'] = $this->castToString($val, $key);
	}

	return strtr($message, $replace);
}