func NewLoggerWithWriter(w io.Writer, env LogEnv, lv zapcore.LevelEnabler, isStackTrace bool) *zap.Logger {
	zap.NewExample()
	writer := zapcore.AddSync(w)
	var encoderCfg zapcore.EncoderConfig
	switch env {
	case LogDev:
		encoderCfg = zap.NewDevelopmentEncoderConfig()
	case LogCustom:
		encoderCfg = zapcore.EncoderConfig{
			MessageKey:     "msg",
			LevelKey:       "lv",
			EncodeLevel:    zapcore.LowercaseLevelEncoder,
			EncodeTime:     zapcore.ISO8601TimeEncoder,
			EncodeDuration: zapcore.StringDurationEncoder,
		}
	default:
		encoderCfg = zap.NewProductionEncoderConfig()
		encoderCfg.TimeKey = "time"
		encoderCfg.EncodeTime = zapcore.ISO8601TimeEncoder
	}
	jsonEncoder := zapcore.NewJSONEncoder(encoderCfg)
	cores := []zapcore.Core{
		zapcore.NewCore(jsonEncoder, writer, lv),
	}
	options := []zap.Option{
		zap.AddCaller(),
		zap.AddCallerSkip(1),
	}
	if isStackTrace {
		options = append(options, zap.AddStacktrace(zap.ErrorLevel))
	}
	logger := zap.New(zapcore.NewTee(cores...), options...)
	return logger
}
NewLoggerWithWriter returns *zap.Logger
package logger
import (
	"io"
	"os"
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
	"github.com/hiromaily/go-gin-wrapper/pkg/config"
)
type LogEnv string
const (
	LogDev    LogEnv = "dev"
	LogProd   LogEnv = "prod"
	LogCustom LogEnv = "custom"
)
func (e LogEnv) String() string {
	return string(e)
}