This commit is contained in:
wangchuxiao
2023-03-14 20:05:48 +08:00
parent 37999fe322
commit 2a49abc74a
3 changed files with 7 additions and 13 deletions
-5
View File
@@ -56,7 +56,6 @@ type ZapLogger struct {
func NewZapLogger() (*ZapLogger, error) {
zapConfig := zap.Config{
Level: zap.NewAtomicLevelAt(zapcore.DebugLevel),
Development: true,
Encoding: "json",
EncoderConfig: zap.NewProductionEncoderConfig(),
DisableStacktrace: true,
@@ -78,10 +77,6 @@ func NewZapLogger() (*ZapLogger, error) {
return zl, nil
}
func (l *ZapLogger) timeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder) {
enc.AppendString(t.Format("2006-01-02 15:04:05"))
}
func (l *ZapLogger) cores() (zap.Option, error) {
c := zap.NewProductionEncoderConfig()
c.EncodeTime = zapcore.ISO8601TimeEncoder