func (logger *Logger) Errorw(message string, fields ...zapcore.Field) {
	if logger.level <= zapcore.ErrorLevel {
		logger.write(zapcore.ErrorLevel, message, fields)
	}
}
Errorw logs a message with some additional context.
package log
import (
	"fmt"
	"io"
	"os"
	"runtime"
	"time"
	"go.uber.org/zap/zapcore"
)
var (
	levelMap = map[string]zapcore.Level{
		zapcore.DebugLevel.String(): zapcore.DebugLevel,
		zapcore.InfoLevel.String():  zapcore.InfoLevel,
		zapcore.WarnLevel.String():  zapcore.WarnLevel,
		zapcore.ErrorLevel.String(): zapcore.ErrorLevel,
		zapcore.PanicLevel.String(): zapcore.PanicLevel,
		zapcore.FatalLevel.String(): zapcore.FatalLevel,
	}
)
type Logger struct {
	writer  io.Writer
	core    zapcore.Core
	level   zapcore.Level
	context string
}
func (logger *Logger) write(level zapcore.Level, message string, fields []zapcore.Field) {
	e := zapcore.Entry{
		Level:      level,
		Time:       time.Now(),
		Message:    message,
		LoggerName: logger.context,
		Caller:     zapcore.NewEntryCaller(runtime.Caller(2)),
	}
	_ = logger.core.Write(e, fields)
}
func (logger *Logger) Sync() (err error) {
	file, ok := logger.writer.(*os.File)
	if ok && file != os.Stdout && file != os.Stderr {
		err = logger.core.Sync()
	}
	return
}
func (logger *Logger) Close() (err error) {
	closer, ok := logger.writer.(io.Closer)
	if ok {
		return closer.Close()
	}
	return nil
}
func (logger *Logger) Debug(args ...interface{}) {
	if logger.level <= zapcore.DebugLevel {
		msg := fmt.Sprint(args...)
		logger.write(zapcore.DebugLevel, msg, nil)
	}
}
func (logger *Logger) Debugf(template string, args ...interface{}) {
	if logger.level <= zapcore.DebugLevel {
		msg := fmt.Sprintf(template, args...)
		logger.write(zapcore.DebugLevel, msg, nil)
	}
}
func (logger *Logger) Debugw(message string, fields ...zapcore.Field) {
	if logger.level <= zapcore.DebugLevel {
		logger.write(zapcore.DebugLevel, message, fields)
	}
}
func (logger *Logger) Info(args ...interface{}) {
	if logger.level <= zapcore.InfoLevel {
		msg := fmt.Sprint(args...)
		logger.write(zapcore.InfoLevel, msg, nil)
	}
}
func (logger *Logger) Infof(template string, args ...interface{}) {
	if logger.level <= zapcore.InfoLevel {
		msg := fmt.Sprintf(template, args...)
		logger.write(zapcore.InfoLevel, msg, nil)
	}
}
func (logger *Logger) Infow(message string, fields ...zapcore.Field) {
	if logger.level <= zapcore.InfoLevel {
		logger.write(zapcore.InfoLevel, message, fields)
	}
}
func (logger *Logger) Warn(args ...interface{}) {
	if logger.level <= zapcore.WarnLevel {
		msg := fmt.Sprint(args...)
		logger.write(zapcore.WarnLevel, msg, nil)
	}
}
func (logger *Logger) Warnf(template string, args ...interface{}) {
	if logger.level <= zapcore.WarnLevel {
		msg := fmt.Sprintf(template, args...)
		logger.write(zapcore.WarnLevel, msg, nil)
	}
}
func (logger *Logger) Warnw(message string, fields ...zapcore.Field) {
	if logger.level <= zapcore.WarnLevel {
		logger.write(zapcore.WarnLevel, message, fields)
	}
}
func (logger *Logger) Error(args ...interface{}) {
	if logger.level <= zapcore.ErrorLevel {
		msg := fmt.Sprint(args...)
		logger.write(zapcore.ErrorLevel, msg, nil)
	}
}
func (logger *Logger) Errorf(template string, args ...interface{}) {
	if logger.level <= zapcore.ErrorLevel {
		msg := fmt.Sprintf(template, args...)
		logger.write(zapcore.ErrorLevel, msg, nil)
	}
}