func log() hclog.Logger {
	if initlb == nil {
		initlb = hclog.NewNullLogger()
	}
	return initlb
}
log is a convenience function that will return a null logger if a
parent logger has not been specified, mostly useful for tests.
package tree
import (
	"github.com/hashicorp/go-hclog"
	"github.com/netauth/netauth/internal/crypto"
	"github.com/netauth/netauth/internal/mresolver"
)
var (
	initlb hclog.Logger
)
func New(db DB, crypto crypto.EMCrypto, l hclog.Logger) (*Manager, error) {
	x := Manager{}
	x.log = l.Named("tree")
	x.db = db
	x.crypto = crypto
	x.resolver = mresolver.New()
	x.resolver.SetParentLogger(x.log)
	x.refContext = RefContext{
		DB:     db,
		Crypto: crypto,
	}
	x.db.RegisterCallback("entity-resolver", x.entityResolverCallback)
	x.db.RegisterCallback("group-resolver", x.groupResolverCallback)
	x.entityHooks = make(map[string]EntityHook)
	x.InitializeEntityHooks()
	x.entityProcesses = make(map[string][]EntityHook)
	x.InitializeEntityChains(defaultEntityChains)
	if err := x.CheckRequiredEntityChains(); err != nil {
		return nil, err
	}
	x.groupHooks = make(map[string]GroupHook)
	x.InitializeGroupHooks()
	x.groupProcesses = make(map[string][]GroupHook)
	x.InitializeGroupChains(defaultGroupChains)
	if err := x.CheckRequiredGroupChains(); err != nil {
		return nil, err
	}
	x.log.Debug("Initialized new Entity Manager")
	return &x, nil
}
func SetParentLogger(l hclog.Logger) {
	initlb = l.Named("tree.init")
}