3namespace Bitrix\Sale\Cashbox;
5use Bitrix\Main\ArgumentTypeException;
6use Bitrix\Main\Config\Option;
7use Bitrix\Main\Type\DateTime;
8use Bitrix\Sale\Cashbox\Internals\CashboxErrLogTable;
27 self::addToLog(
$message, $cashboxId, static::TRACE_LEVEL_ERROR);
36 self::addToLog(
$message, $cashboxId, static::TRACE_LEVEL_WARNING);
45 self::addToLog(
$message, $cashboxId, static::TRACE_LEVEL_DEBUG);
52 private static function validateMessage(?
string $message): bool
61 private static function checkMessageLevel(
int $messageLevel): bool
63 return $messageLevel <= self::getLevel();
71 private static function addToLog(?
string $message, $cashboxId, $messageLevel): void
73 if (self::checkMessageLevel($messageLevel) && self::validateMessage(
$message))
76 'CASHBOX_ID' => $cashboxId,
78 'DATE_INSERT' =>
new DateTime()
81 CashboxErrLogTable::add(
$data);
90 private static function getLevel(): int
92 return (
int)Option::get(
'sale',
'cashbox_log_level', static::TRACE_LEVEL_ERROR);
const TRACE_LEVEL_WARNING
static addDebugInfo(?string $message, $cashboxId=null)
static addWarning(?string $message, $cashboxId=null)
static addError(?string $message, $cashboxId=null)