func (l *Logger) With(fields Fields) MiniLogger {
	for k, v := range l.fields {
		fields[k] = v
	}
	s, _ := json.Marshal(fields)
	return &Logger{
		mu:           sync.Mutex{},
		modeSafe:     l.modeSafe,
		wait:         sync.WaitGroup{},
		writersMap:   l.writersMap,
		fields:       fields,
		fieldsString: string(s),
	}
}
With return a new MiniLogger,which it's modeSafe inited same as caller MiniLogger,
and revecived levels  same as caller MiniLogger,
and set it's fields.
you can use it as a standard MiniLogger.
package logger
import (
	"encoding/json"
	"fmt"
	"os"
	"sync"
	"time"
)
const (
	DebugLevel uint8 = 1
	InfoLevel  uint8 = 1 << 1
	WarnLevel  uint8 = 1 << 2
	ErrorLevel uint8 = 1 << 3
	FatalLevel uint8 = 1 << 4
	AllLevels  uint8 = byte(DebugLevel | InfoLevel | WarnLevel | ErrorLevel | FatalLevel)
)
var (
	flush   = &sync.WaitGroup{}
	exitchn = make(chan bool, 1)
)
type Fields map[string]string
type Writer interface {
	Write(e Entry)
	Init() error
}
type Logger struct {
	writersMap   *map[int][]*WrappedWriter
	mu           sync.Mutex
	modeSafe     bool
	wait         sync.WaitGroup
	fields       Fields
	fieldsString string
}
type WrappedWriter struct {
	lock   *sync.Mutex
	chn    chan Entry
	writer Writer
	wait   sync.WaitGroup
}
type Entry struct {
	Content               string
	Timestamp             int64
	Milliseconds          int64
	TimestampMilliseconds int64
	Level                 uint8
	LevelString           string
	Fields                map[string]string
	FieldsString          string
}
type MiniLogger interface {
	Debug(v ...interface{}) MiniLogger
	Info(v ...interface{}) MiniLogger
	Warn(v ...interface{}) MiniLogger
	Error(v ...interface{}) MiniLogger
	Fatal(v ...interface{})
	Debugf(format string, v ...interface{}) MiniLogger
	Infof(format string, v ...interface{}) MiniLogger
	Warnf(format string, v ...interface{}) MiniLogger
	Errorf(format string, v ...interface{}) MiniLogger
	Fatalf(format string, v ...interface{})
	Debugln(v ...interface{}) MiniLogger
	Infoln(v ...interface{}) MiniLogger
	Warnln(v ...interface{}) MiniLogger
	Errorln(v ...interface{}) MiniLogger
	Fatalln(v ...interface{})
	AddWriter(w Writer, levels uint8) MiniLogger
	Safe() MiniLogger
	Unsafe() MiniLogger
	With(fields Fields) MiniLogger
}
func getLevelString(level uint8) string {
	switch level {
	case DebugLevel:
		return "DEBUG"
	case InfoLevel:
		return "INFO"
	case WarnLevel:
		return "WARN"
	case ErrorLevel:
		return "ERROR"
	case FatalLevel:
		return "FATAL"
	}
	return "UNKOWN"
}
func New(modeSafe bool, fields Fields) MiniLogger {
	if fields == nil {
		fields = Fields{}
	}
	return &Logger{
		fields:       fields,
		fieldsString: "",
		mu:           sync.Mutex{},
		modeSafe:     modeSafe,
		wait:         sync.WaitGroup{},
		writersMap: &map[int][]*WrappedWriter{
			int(DebugLevel): []*WrappedWriter{},
			int(InfoLevel):  []*WrappedWriter{},
			int(WarnLevel):  []*WrappedWriter{},
			int(ErrorLevel): []*WrappedWriter{},
			int(FatalLevel): []*WrappedWriter{},
		},
	}
}
func Flush() {
	exitchn <- true
	flush.Wait()
}