def METHOD_NAME(self, namespace: str) -> NamedConstant:
    """
    Determine an appropriate log level for the given namespace.
    This respects dots in namespaces; for example, if you have previously
    invoked C{setLogLevelForNamespace("mypackage", LogLevel.debug)}, then
    C{logLevelForNamespace("mypackage.subpackage")} will return
    C{LogLevel.debug}.
    @param namespace: A logging namespace.  Use C{""} for the default
        namespace.
    @return: The log level for the specified namespace.
    """
    if not namespace:
        return self._logLevelsByNamespace[""]
    if namespace in self._logLevelsByNamespace:
        return self._logLevelsByNamespace[namespace]
    segments = namespace.split(".")
    index = len(segments) - 1
    while index > 0:
        namespace = ".".join(segments[:index])
        if namespace in self._logLevelsByNamespace:
            return self._logLevelsByNamespace[namespace]
        index -= 1
    return self._logLevelsByNamespace[""]