func (d *Descriptor) Log() *log.Entry {
	return d.log
}
Log returns logger with associated fields. Fields are inherited from the
parent logger.
package actor
import (
	"bytes"
	"fmt"
	"runtime/debug"
	"sync"
	log "github.com/sirupsen/logrus"
)
const fieldActorName = "tid"
type Descriptor struct {
	absoluteName string
	log          *log.Entry
	childrenMu     sync.Mutex
	childrenCounts map[string]int32
}
var root = Descriptor{log: log.NewEntry(log.StandardLogger())}
func Root() *Descriptor {
	return &root
}
func (d *Descriptor) NewChild(nameParts ...interface{}) *Descriptor {
	if len(nameParts) == 0 {
		return d
	}
	var buf bytes.Buffer
	for i, p := range nameParts {
		if i != 0 {
			buf.WriteString("_")
		}
		buf.WriteString(fmt.Sprintf("%v", p))
	}
	name := buf.String()
	d.childrenMu.Lock()
	if d.childrenCounts == nil {
		d.childrenCounts = make(map[string]int32)
	}
	idx := d.childrenCounts[name]
	d.childrenCounts[name] = idx + 1
	d.childrenMu.Unlock()
	childAbsName := fmt.Sprintf("%s/%s.%d", d.absoluteName, name, idx)
	childLog := d.log.WithField(fieldActorName, childAbsName)
	child := Descriptor{
		absoluteName: childAbsName,
		log:          childLog,
	}
	return &child
}
func (d *Descriptor) AddLogField(key string, value interface{}) {
	d.log = d.log.WithField(key, value)
}