Skip to content

Commit

Permalink
Zap 1.16 (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
argylelabcoat authored Sep 28, 2021
1 parent 114436e commit a2de8e2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
9 changes: 6 additions & 3 deletions configuration/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@ var PluginsDir string
func init() {
// initialize startup logger
logCfg := zap.NewProductionConfig()
var err error

logCfg.DisableStacktrace = true
logCfg.Level = zap.NewAtomicLevelAt(zap.DebugLevel)
logCfg.EncoderConfig.LevelKey = ""
logCfg.EncoderConfig.CallerKey = ""
logCfg.Encoding = "console"
logCfg.EncoderConfig.EncodeTime = nil
logCfg.EncoderConfig.EncodeTime = zapcore.TimeEncoderOfLayout("")

log, _ := logCfg.Build()
log, err := logCfg.Build()
if nil != err {
panic(err.Error())
}

cfg.humanLog = log.Sugar()

Expand All @@ -64,7 +68,6 @@ func init() {
flag.StringVar(&WorkDir, "work-dir", WorkDir, "service work directory")
flag.StringVar(&PluginsDir, "plugins-dir", PluginsDir, "service plugins directory")

var err error
WorkDir, err = filepath.Abs(WorkDir)
if err != nil {
panic(err.Error())
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/troian/healthcheck v0.1.3
github.com/vbauerster/mpb/v4 v4.9.4
gitlab.com/VolantMQ/vlplugin/persistence/mem v0.0.7
go.uber.org/zap v1.12.0
go.uber.org/zap v1.16.0
golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad // indirect
gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71
)
10 changes: 6 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down Expand Up @@ -100,14 +99,17 @@ github.com/vbauerster/mpb/v4 v4.9.4 h1:aGaMDanOSnCZxjaAp09+eSlu3v9Eekpj2oBJ7j+UL
github.com/vbauerster/mpb/v4 v4.9.4/go.mod h1:xMKSr3w3dixpCH9v7svY4wF3mmhuyWYuYtkpy8T5FOk=
gitlab.com/VolantMQ/vlplugin/persistence/mem v0.0.7 h1:E2NLgsdnBviLwAxITpwuYVpkdm8M2CVF4HqcL+s2dPs=
gitlab.com/VolantMQ/vlplugin/persistence/mem v0.0.7/go.mod h1:Z8Gd3SseNsIc4DScndW2L7zUlnqkPSw5mB8F1Y1tWDY=
go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc=
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
go.uber.org/zap v1.12.0 h1:dySoUQPFBGj6xwjmBzageVL8jGi8uxc6bEmJQjA06bw=
go.uber.org/zap v1.12.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM=
go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand Down

0 comments on commit a2de8e2

Please sign in to comment.