log/namespaced/namespaces.go
func (n *ns) IsEnabled(namespace string) bool {
	n.RLock()
	defer n.RUnlock()

	if namespace == "" {
		return true
	}

	hasStar := false
	included := false

	for _, ns := range n.namespaces {
		// if the namspace is negated, it can never be enabled
		if ns == negate(namespace) {
			return false
		}

		// if the namespace is explicitly enabled, mark it as included
		if ns == namespace {
			included = true
		}

		// mark that we have a *
		if ns == "*" {
			hasStar = true
		}
	}

	// non-mentioned namespaces are only enabled if we got the catch-all *
	return hasStar || included
}
func (n *ns) IsEnabled(namespace string) bool {
	n.RLock()
	defer n.RUnlock()

	if namespace == "" {
		return true
	}

	hasStar := false
	included := false

	for _, ns := range n.namespaces {
		// if the namspace is negated, it can never be enabled
		if ns == negate(namespace) {
			return false
		}

		// if the namespace is explicitly enabled, mark it as included
		if ns == namespace {
			included = true
		}

		// mark that we have a *
		if ns == "*" {
			hasStar = true
		}
	}

	// non-mentioned namespaces are only enabled if we got the catch-all *
	return hasStar || included
}
// isEnabled checks wether or not the namespace is enabled