Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
logger.php
1
<?
2
namespace
Bitrix\Scale
;
3
4
use
Bitrix\Main\Localization\Loc
;
5
Loc::loadMessages
(__FILE__);
6
12
class
Logger
13
{
14
const
LOG_LEVEL_DISABLE
= 0;
15
const
LOG_LEVEL_ERROR
= 10;
16
const
LOG_LEVEL_INFO
= 20;
17
const
LOG_LEVEL_DEBUG
= 30;
18
26
public
static
function
addRecord
($level, $auditType, $itemId, $description)
27
{
28
if
($level == self::LOG_LEVEL_ERROR)
29
$severity =
"ERROR"
;
30
elseif($level == self::LOG_LEVEL_INFO)
31
$severity =
"INFO"
;
32
elseif($level == self::LOG_LEVEL_DEBUG)
33
$severity =
"DEBUG"
;
34
else
35
$severity =
"UNKNOWN"
;
36
37
\CEventLog::Add(array(
38
"SEVERITY"
=> $severity,
39
"AUDIT_TYPE_ID"
=> $auditType,
40
"MODULE_ID"
=>
"scale"
,
41
"ITEM_ID"
=> $itemId,
42
"DESCRIPTION"
=> $description,
43
));
44
45
return
true
;
46
}
47
51
public
static
function
onEventLogGetAuditTypes
()
52
{
53
return
array(
54
"SCALE_ACTION_STARTED"
=>
"[SCALE_ACTION_STARTED] "
.
Loc::getMessage
(
"SCALE_ACTION_EVENT_LOG_TYPE_ACTION_STARTED"
),
55
"SCALE_ACTION_RESULT"
=>
"[SCALE_ACTION_RESULT] "
.
Loc::getMessage
(
"SCALE_ACTION_EVENT_LOG_TYPE_ACTION_RESULT"
),
56
"SCALE_ACTION_ERROR"
=>
"[SCALE_ACTION_ERROR] "
.
Loc::getMessage
(
"SCALE_ACTION_EVENT_LOG_TYPE_ACTION_ERROR"
),
57
"SCALE_ACTION_OUTPUT"
=>
"[SCALE_ACTION_OUTPUT] "
.
Loc::getMessage
(
"SCALE_ACTION_EVENT_LOG_TYPE_ACTION_OUTPUT"
),
58
"SCALE_ACTION_CHECK_STATE"
=>
"[SCALE_ACTION_CHECK_STATE] "
.
Loc::getMessage
(
"SCALE_ACTION_EVENT_LOG_TYPE_ACTION_CHECK_STATE"
),
59
"SCALE_PROVIDER_SEND_ORDER"
=>
"[SCALE_PROVIDER_SEND_ORDER] "
.
Loc::getMessage
(
"SCALE_ACTION_EVENT_LOG_TYPE_PROVIDER_SEND_ORDER"
)
60
);
61
}
62
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Scale\Logger
Definition
logger.php:13
Bitrix\Scale\Logger\LOG_LEVEL_INFO
const LOG_LEVEL_INFO
Definition
logger.php:16
Bitrix\Scale\Logger\LOG_LEVEL_DISABLE
const LOG_LEVEL_DISABLE
Definition
logger.php:14
Bitrix\Scale\Logger\addRecord
static addRecord($level, $auditType, $itemId, $description)
Definition
logger.php:26
Bitrix\Scale\Logger\LOG_LEVEL_DEBUG
const LOG_LEVEL_DEBUG
Definition
logger.php:17
Bitrix\Scale\Logger\LOG_LEVEL_ERROR
const LOG_LEVEL_ERROR
Definition
logger.php:15
Bitrix\Scale\Logger\onEventLogGetAuditTypes
static onEventLogGetAuditTypes()
Definition
logger.php:51
Bitrix\Scale
Definition
action.php:2
modules
scale
lib
logger.php
Создано системой
1.10.0