• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/log.php
  • Класс: BitrixImOpenLinesLog
  • Вызов: Log::write
static function write($data, $title = '')
{
	if (!BitrixMainConfigOption::get("imopenlines", "debug"))
		return false;

	if (is_array($data))
	{
		unset($data['HASH']);
		unset($data['BX_HASH']);
	}
	else if (is_object($data))
	{
		if ($data->HASH)
		{
			$data->HASH = '';
		}
		if ($data->BX_HASH)
		{
			$data->BX_HASH = '';
		}
	}

	$log = "n------------------------n";
	$log .= date("Y.m.d G:i:s")."n";
	$log .= ($title <> '' ? $title : 'DEBUG')."n";
	$log .= print_r($data, 1);
	$log .= "n------------------------n";

	if (function_exists('BXSiteLog'))
	{
		BXSiteLog("imopenlines.log", $log);
	}
	else
	{
		BitrixMainIOFile::putFileContents($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/imopenlines.log", $log, BitrixMainIOFile::APPEND);
	}

	return true;
}