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);