public function log(GitEvent $gitEvent, string $message, array $context = [], ?string $eventName = null): void
    {
        // Provide backwards compatibility with Symfony 2.
        if ($eventName === null && method_exists($gitEvent, 'getName')) {
            $eventName = $gitEvent->getName();
        }

        $method = $this->getLogLevelMapping($eventName);
        $context += ['command' => $gitEvent->getProcess()->getCommandLine()];
        $this->logger->{$method}($message, $context);
    }