func CreateLogger(c *zap.Config, pidPath string, removePIDfunc removePIDfunc) (*Logger, error) {
	l, err := c.Build()
	if err != nil {
		return nil, errors.Wrap(err, "failed to create logger")
	}
	pl := Logger{
		Logger:    l,
		PIDPath:   pidPath,
		RemovePID: removePIDfunc,
	}
	return &pl, nil
}
CreateLogger creates a zap logger.
package log
import (
	"io/ioutil"
	"os"
	"github.com/pkg/errors"
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
)
type removePIDfunc func(fname string, logger *Logger)
type Logger struct {
	*zap.Logger
	PIDPath   string
	RemovePID removePIDfunc
}
func (log *Logger) Fatal(msg string, fields ...zapcore.Field) {
	log.RemovePID(log.PIDPath, log)
	log.Logger.Fatal(msg, fields...)
}
func (log *Logger) Panic(msg string, fields ...zapcore.Field) {
	log.RemovePID(log.PIDPath, log)
	log.Logger.Panic(msg, fields...)
}
type Config struct {
	Level   string `yaml:"level"`
	StdOut  bool   `yaml:"stdout"`
	LogSink string `yaml:"logSink"`
}