etcd can set log config
default log level is info, which will log o log of unused logs
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/micro/go-micro/registry"
|
||||
"github.com/micro/go-micro/util/log"
|
||||
hash "github.com/mitchellh/hashstructure"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -73,6 +74,10 @@ func configure(e *etcdRegistry, opts ...registry.Option) error {
|
||||
config.Username = u.Username
|
||||
config.Password = u.Password
|
||||
}
|
||||
cfg, ok := e.options.Context.Value(logConfigKey{}).(*zap.Config)
|
||||
if ok && cfg != nil {
|
||||
config.LogConfig = cfg
|
||||
}
|
||||
}
|
||||
|
||||
var cAddrs []string
|
||||
|
||||
Reference in New Issue
Block a user