'Sets the log level for a logging namespace.
@param namespace: A logging namespace.
@type namespace: L{str} (native string)
@param level: The log level for the given namespace.
@type level: L{LogLevel}'

def setLogLevelForNamespace(self, namespace, level):

    if (level not in LogLevel.iterconstants()):
        raise InvalidLogLevelError(level)
    if namespace:
        self._logLevelsByNamespace[namespace] = level
    else:
        self._logLevelsByNamespace[None] = level
