cli/internal/logging/zap.go

15 lines
373 B
Go
Raw Normal View History

2022-11-18 23:25:41 +00:00
package logging
import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
func NewZapLogger() (*zap.Logger, error) {
zapCfg := zap.NewDevelopmentConfig()
2022-11-19 18:47:28 +00:00
zapCfg.DisableStacktrace = true
2022-11-18 23:25:41 +00:00
zapCfg.EncoderConfig.EncodeLevel = zapcore.CapitalColorLevelEncoder
zapCfg.EncoderConfig.EncodeTime = zapcore.TimeEncoderOfLayout("2006/01/02 15:04:05.000")
return zapCfg.Build()
}