def METHOD_NAME(self, namespace: str, level: NamedConstant) -> None:
    """
    Sets the log level for a logging namespace.
    @param namespace: A logging namespace.
    @param level: The log level for the given namespace.
    """
    if level not in LogLevel.iterconstants():
        raise InvalidLogLevelError(level)
    if namespace:
        self._logLevelsByNamespace[namespace] = level
    else:
        self._logLevelsByNamespace[""] = level