Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
debug.php
1<?php
2namespace Bitrix\Landing;
3
5
6class Debug
7{
12 public static function q()
13 {
14 return \Bitrix\Main\Entity\Query::getLastQuery();
15 }
16
24 public static function log($itemId, $itemDesc, $typeId = 'LANDING_LOG')
25 {
26 if (is_array($itemDesc))
27 {
28 $itemDesc = print_r($itemDesc, true);
29 }
30 \CEventLog::add([
31 'SEVERITY' => 'NOTICE',
32 'AUDIT_TYPE_ID' => $typeId,
33 'MODULE_ID' => 'landing',
34 'ITEM_ID' => $itemId,
35 'DESCRIPTION' => $itemDesc
36 ]);
37 }
38
44 public static function logToFile(string $message): void
45 {
46 static $write = null;
47
48 if ($write === null)
49 {
50 $write = defined('LANDING_FILE_WORK_LOG_TO_FILE') && LANDING_FILE_WORK_LOG_TO_FILE === true;
51
52 if (!$write && ModuleManager::isModuleInstalled('bitrix24') && !Manager::isCloudDisable())
53 {
54 $write = true;
55 }
56 }
57
58 if ($write)
59 {
60 AddMessage2Log($message, 'landing', 7);
61 }
62 }
63}
static logToFile(string $message)
Definition debug.php:44
static log($itemId, $itemDesc, $typeId='LANDING_LOG')
Definition debug.php:24