Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
loggerdiag.php
1
<?php
2
3
4
namespace
Bitrix\Sale\Rest\Synchronization
;
5
6
7
use
Bitrix\Main\Localization\Loc
;
8
use
Bitrix\Main\Type\DateTime
;
9
use
Bitrix\Sale\Internals\SynchronizerLogTable
;
10
11
class
LoggerDiag
extends
\Bitrix\Sale\Exchange\Internals\LoggerDiagBase
12
{
13
static
protected
function
getNameOptionEndTime
()
14
{
15
return
'rest_debug_end_time'
;
16
}
17
18
static
protected
function
getNameOptionIntervalDayOption
()
19
{
20
return
"synchronizer_debug_interval_day"
;
21
}
22
23
public
function
save
()
24
{
25
$params[
'MESSAGE_ID'
] = $this->
getField
(
'MESSAGE_ID'
);
26
$params[
'MESSAGE'
] = $this->
getField
(
'MESSAGE'
);
27
$params[
'DATE_INSERT'
] =
new
DateTime
();
28
29
return
static::log($params);
30
}
31
32
static
public
function
log
(array $params)
33
{
34
return
static::isOn() ?
SynchronizerLogTable::add
($params):
null
;
35
}
36
37
static
public
function
addMessage
($messageId, $message=
''
)
38
{
39
$mess = static::getMessage();
40
41
$logger =
new
static
();
42
$logger->setField(
'MESSAGE_ID'
, isset($mess[
'LOGGER_'
.$messageId])?$mess[
'LOGGER_'
.$messageId]:$messageId);
43
$logger->setField(
'MESSAGE'
, $message);
44
$logger->save();
45
}
46
47
protected
static
function
getMessage
()
48
{
49
return
Loc::loadLanguageFile
($_SERVER[
"DOCUMENT_ROOT"
].
'/bitrix/modules/sale/lib/rest/synchronization/loggerdiag.php'
);
50
}
51
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadLanguageFile
static loadLanguageFile($file, $language=null, $normalize=true)
Definition
loc.php:224
Bitrix\Main\ORM\Data\DataManager\add
static add(array $data)
Definition
datamanager.php:874
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Sale\Exchange\Internals\LoggerDiagBase
Definition
loggerdiagbase.php:11
Bitrix\Sale\Exchange\Internals\Logger\getField
getField($name)
Definition
logger.php:43
Bitrix\Sale\Internals\SynchronizerLogTable
Definition
synchronizerlog.php:31
Bitrix\Sale\Rest\Synchronization\LoggerDiag
Definition
loggerdiag.php:12
Bitrix\Sale\Rest\Synchronization\LoggerDiag\getMessage
static getMessage()
Definition
loggerdiag.php:47
Bitrix\Sale\Rest\Synchronization\LoggerDiag\getNameOptionIntervalDayOption
static getNameOptionIntervalDayOption()
Definition
loggerdiag.php:18
Bitrix\Sale\Rest\Synchronization\LoggerDiag\addMessage
static addMessage($messageId, $message='')
Definition
loggerdiag.php:37
Bitrix\Sale\Rest\Synchronization\LoggerDiag\log
static log(array $params)
Definition
loggerdiag.php:32
Bitrix\Sale\Rest\Synchronization\LoggerDiag\save
save()
Definition
loggerdiag.php:23
Bitrix\Sale\Rest\Synchronization\LoggerDiag\getNameOptionEndTime
static getNameOptionEndTime()
Definition
loggerdiag.php:13
Bitrix\Sale\Rest\Synchronization
Definition
client.php:4
modules
sale
lib
rest
synchronization
loggerdiag.php
Создано системой
1.10.0