src/Leevel/Debug/Debug.php
protected function logEventDispatch(): void
    {
        $this->getEventDispatch()->

        register(ILog::LOG_EVENT, function (string $event, string $level, string $message, array $context = []) {
            $this->getCollector('logs')->addMessage(File::formatMessage($level, $message, $context), $level);
        });
    }
protected function logEventDispatch(): void
    {
        $this->getEventDispatch()->

        register(ILog::LOG_EVENT, function (string $event, string $level, string $message, array $context = []) {
            $this->getCollector('logs')->addMessage(File::formatMessage($level, $message, $context), $level);
        });
    }
设置日志监听器.