Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
loggerdiag.php
1<?php
2
3
5
6
10
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}
static loadLanguageFile($file, $language=null, $normalize=true)
Definition loc.php:224
static addMessage($messageId, $message='')