private function prepareLogLevels(string $level)
    {
        $levels = [
            LogLevel::EMERGENCY,
            LogLevel::ALERT,
            LogLevel::CRITICAL,
            LogLevel::ERROR,
            LogLevel::WARNING,
            LogLevel::NOTICE,
            LogLevel::INFO,
            LogLevel::DEBUG,
        ];

        $key = array_search($level, $levels);

        if (null !== $key) {
            $this->levels = array_slice($levels, 0, $key + 1);
        }
    }