Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
log.php
1<?php
2namespace Bitrix\Pull;
3
4class Log
5{
6 public static function isEnabled()
7 {
8 return \Bitrix\Main\Config\Option::get("pull", "debug", false) != false;
9 }
10
11 public static function write($data, $title = '')
12 {
13 if (!self::isEnabled())
14 return false;
15
16 $log = "\n------------------------\n";
17 $log .= date("Y.m.d G:i:s")."\n";
18 $log .= ($title <> '' ? $title : 'DEBUG')."\n";
19 $log .= print_r($data, 1);
20 $log .= "\n------------------------\n";
21
22 if (function_exists('BXSiteLog'))
23 {
24 BXSiteLog("pull.log", $log);
25 }
26 else
27 {
28 \Bitrix\Main\IO\File::putFileContents($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/pull.log", $log, \Bitrix\Main\IO\File::APPEND);
29 }
30
31 return true;
32 }
33}
static isEnabled()
Definition log.php:6
static write($data, $title='')
Definition log.php:11