func NewHexLogger() *zap.Logger {
	encoderConfig := zapcore.EncoderConfig{
		EncodeLevel:    zapcore.LowercaseLevelEncoder,
		EncodeTime:     zapcore.ISO8601TimeEncoder,
		EncodeDuration: zapcore.StringDurationEncoder,
		EncodeCaller:   zapcore.ShortCallerEncoder,
	}
	return newDumpLogger(encoderConfig)
}
NewHexLogger returns logger for hex
package logger
import (
	"fmt"
	"io"
	"log"
	"os"
	"os/exec"
	"path/filepath"
	"time"
	ltsv "github.com/hnakamur/zap-ltsv"
	rotatelogs "github.com/lestrrat-go/file-rotatelogs"
	"github.com/spf13/viper"
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
)
const LogFormatJSON = "json"
const LogFormatLTSV = "ltsv"
const LogTypeLog = "log"
const LogTypeDumpLog = "dumpLog"
func NewLogger() *zap.Logger {
	encoderConfig := zapcore.EncoderConfig{
		TimeKey:        "ts",
		LevelKey:       "level",
		NameKey:        "logger",
		CallerKey:      "caller",
		MessageKey:     "msg",
		StacktraceKey:  "stacktrace",
		EncodeLevel:    zapcore.LowercaseLevelEncoder,
		EncodeTime:     zapcore.ISO8601TimeEncoder,
		EncodeDuration: zapcore.StringDurationEncoder,
		EncodeCaller:   zapcore.ShortCallerEncoder,
	}
	stdout := viper.GetBool(fmt.Sprintf("%s.stdout", LogTypeLog))
	enable := viper.GetBool(fmt.Sprintf("%s.enable", LogTypeLog))
	format := viper.GetString(fmt.Sprintf("%s.format", LogTypeLog))
	cores := []zapcore.Core{}
	if stdout {
		stdoutCore := zapcore.NewCore(
			zapcore.NewConsoleEncoder(encoderConfig),
			zapcore.AddSync(os.Stdout),
			zapcore.DebugLevel,
		)
		cores = append(cores, stdoutCore)
	}
	if enable {
		w := newLogWriter(LogTypeLog)
		var encoder zapcore.Encoder
		switch format {
		case LogFormatJSON:
			encoder = zapcore.NewJSONEncoder(encoderConfig)
		case LogFormatLTSV:
			encoder = ltsv.NewLTSVEncoder(encoderConfig)
		}
		logCore := zapcore.NewCore(
			encoder,
			zapcore.AddSync(w),
			zapcore.InfoLevel,
		)
		cores = append(cores, logCore)
	}
	logger := zap.New(zapcore.NewTee(cores...))
	return logger
}