func (r *Factory) NewLogger(name string) Logger {
	return r.NewCore(name)
}
NewLogger returns a new Logger
package flume
import (
	"fmt"
	"github.com/ansel1/merry"
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
	"io"
	"os"
	"strings"
	"sync"
)
type loggerInfo struct {
	levelEnabler    zapcore.LevelEnabler
	atomicInnerCore atomicInnerCore
}
type Factory struct {
	defaultLevel zap.AtomicLevel
	encoder zapcore.Encoder
	out     io.Writer
	loggers map[string]*loggerInfo
	sync.Mutex
	addCaller bool
	hooks []HookFunc
}
type Encoder zapcore.Encoder
func NewFactory() *Factory {
	f := Factory{
		defaultLevel: zap.NewAtomicLevel(),
		loggers:      map[string]*loggerInfo{},
	}
	f.SetDefaultLevel(OffLevel)
	return &f
}
func (r *Factory) getEncoder() zapcore.Encoder {
	if r.encoder == nil {
		return NewLTSVEncoder(NewEncoderConfig())
	}
	return r.encoder
}
func (r *Factory) SetEncoder(e Encoder) {
	r.Lock()
	defer r.Unlock()
	r.encoder = e
	r.refreshLoggers()
}
func (r *Factory) SetOut(w io.Writer) func() {
	r.Lock()
	defer r.Unlock()
	prior := r.out
	r.out = w
	r.refreshLoggers()
	return func() {
		r.SetOut(prior)
	}
}
func (r *Factory) SetAddCaller(b bool) {
	r.Lock()
	defer r.Unlock()
	r.addCaller = b
	r.refreshLoggers()
}
func (r *Factory) getOut() io.Writer {
	if r.out == nil {
		return os.Stdout
	}
	return r.out
}
func (r *Factory) refreshLoggers() {
	for name, info := range r.loggers {
		info.atomicInnerCore.set(r.newInnerCore(name, info))
	}
}
func (r *Factory) getLoggerInfo(name string) *loggerInfo {
	info, found := r.loggers[name]
	if !found {
		info = &loggerInfo{}
		r.loggers[name] = info
		info.atomicInnerCore.set(r.newInnerCore(name, info))
	}
	return info
}
func (r *Factory) newInnerCore(name string, info *loggerInfo) *innerCore {
	var l zapcore.LevelEnabler
	switch {
	case info.levelEnabler != nil:
		l = info.levelEnabler
	default:
		l = r.defaultLevel
	}
	zc := zapcore.NewCore(
		r.getEncoder(),
		zapcore.AddSync(r.getOut()),
		l,
	)
	return &innerCore{
		name:        name,
		Core:        zc,
		addCaller:   r.addCaller,
		errorOutput: zapcore.AddSync(os.Stderr),
		hooks:       r.hooks,
	}
}