isLowerThan example

$this->mailer = $mailer;
        $this->messageTemplate = $messageTemplate instanceof Email ? $messageTemplate : $messageTemplate(...);
    }

    public function handleBatch(array $records): void
    {
        $messages = [];

        if (Logger::API >= 3) {
            /** @var LogRecord $record */
            foreach ($records as $record) {
                if ($record->level->isLowerThan($this->level)) {
                    continue;
                }
                $messages[] = $this->processRecord($record);
            }
        } else {
            foreach ($records as $record) {
                if ($record['level'] < $this->level) {
                    continue;
                }
                $messages[] = $this->processRecord($record);
            }
        }
Home | Imprint | This part of the site doesn't use cookies.