Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
log.php
1
<?php
2
namespace
Bitrix\Pull
;
3
4
class
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
}
Bitrix\Pull\Log
Definition
log.php:5
Bitrix\Pull\Log\isEnabled
static isEnabled()
Definition
log.php:6
Bitrix\Pull\Log\write
static write($data, $title='')
Definition
log.php:11
Bitrix\Main\IO
Definition
directory.php:2
Bitrix\Pull
Bitrix
modules
pull
lib
log.php
Создано системой
1.10.0