src/Leevel/Log/Log.php
public function log(string $level, string $message, array $context = []): void
    {
        if (!in_array($level, $this->option['levels'], true)) {
            return;
        }

        $data = [$level, $message, $context];

        $this->handleDispatch($data);

        $this->count++;
        $this->logs[$level][] = $data;

        if (false === $this->option['buffer'] ||
            ($this->option['buffer_size'] && $this->count >= $this->option['buffer_size'])) {
            $this->flush();
        }
    }
public function log(string $level, string $message, array $context = []): void
    {
        if (!in_array($level, $this->option['levels'], true)) {
            return;
        }

        $data = [$level, $message, $context];

        $this->handleDispatch($data);

        $this->count++;
        $this->logs[$level][] = $data;

        if (false === $this->option['buffer'] ||
            ($this->option['buffer_size'] && $this->count >= $this->option['buffer_size'])) {
            $this->flush();
        }
    }
记录特定级别的日志信息.

@param mixed  $level
@param string $message
@param array  $context