remove redundant log messages

Signed-off-by: kkkkun <scuzk373x@gmail.com>
dependabot/go_modules/go.uber.org/atomic-1.10.0
kkkkun 2022-09-16 11:45:39 +08:00
parent 5707147363
commit c4582aaaee
2 changed files with 9 additions and 6 deletions

View File

@ -23,6 +23,8 @@ import (
"sync"
"syscall"
"go.etcd.io/etcd/client/pkg/v3/verify"
"go.uber.org/zap"
)
@ -47,6 +49,7 @@ func RegisterInterruptHandler(h InterruptHandler) {
// HandleInterrupts calls the handler functions on receiving a SIGINT or SIGTERM.
func HandleInterrupts(lg *zap.Logger) {
verify.Assert(lg != nil, "the logger should not be nil")
notifier := make(chan os.Signal, 1)
signal.Notify(notifier, syscall.SIGINT, syscall.SIGTERM)
@ -60,9 +63,7 @@ func HandleInterrupts(lg *zap.Logger) {
interruptExitMu.Lock()
if lg != nil {
lg.Info("received signal; shutting down", zap.String("signal", sig.String()))
}
lg.Info("received signal; shutting down", zap.String("signal", sig.String()))
for _, h := range ihs {
h()

View File

@ -120,10 +120,12 @@ func startEtcdOrProxyV2(args []string) {
)
}
} else {
lg.Info(
"Initialize and start etcd server",
zap.String("data-dir", cfg.ec.Dir),
zap.String("dir-type", string(which)),
)
stopped, errc, err = startEtcd(&cfg.ec)
if err != nil {
lg.Warn("failed to start etcd", zap.Error(err))
}
}
if err != nil {