diff --git a/config/consumer_config.go b/config/consumer_config.go index dd39b46b0d..c49811f6af 100644 --- a/config/consumer_config.go +++ b/config/consumer_config.go @@ -19,6 +19,7 @@ package config import ( "fmt" + "strings" "time" ) @@ -65,12 +66,25 @@ func (cc *ConsumerConfig) Init(rc *RootConfig) error { if cc == nil { return nil } + + buildDebugMsg := func() string { + if len(cc.References) == 0 { + return "empty" + } + consumerNames := make([]string, 0, len(cc.References)) + for k := range cc.References { + consumerNames = append(consumerNames, k) + } + return strings.Join(consumerNames, ", ") + } + logger.Debugf("Registered consumer clients are %v", buildDebugMsg()) + cc.RegistryIDs = translateIds(cc.RegistryIDs) if len(cc.RegistryIDs) <= 0 { cc.RegistryIDs = rc.getRegistryIds() } if cc.TracingKey == "" && len(rc.Tracing) > 0 { - for k, _ := range rc.Tracing { + for k := range rc.Tracing { cc.TracingKey = k break } diff --git a/config/provider_config.go b/config/provider_config.go index 926fbf62e0..364319192f 100644 --- a/config/provider_config.go +++ b/config/provider_config.go @@ -19,6 +19,7 @@ package config import ( "fmt" + "strings" ) import ( @@ -75,6 +76,18 @@ func (c *ProviderConfig) Init(rc *RootConfig) error { if c == nil { return nil } + buildDebugMsg := func() string { + if len(c.Services) == 0 { + return "empty" + } + providerNames := make([]string, 0, len(c.Services)) + for k := range c.Services { + providerNames = append(providerNames, k) + } + return strings.Join(providerNames, ", ") + } + logger.Debugf("Registered provider services are %v", buildDebugMsg()) + c.RegistryIDs = translateIds(c.RegistryIDs) if len(c.RegistryIDs) <= 0 { c.RegistryIDs = rc.getRegistryIds() @@ -82,7 +95,7 @@ func (c *ProviderConfig) Init(rc *RootConfig) error { c.ProtocolIDs = translateIds(c.ProtocolIDs) if c.TracingKey == "" && len(rc.Tracing) > 0 { - for k, _ := range rc.Tracing { + for k := range rc.Tracing { c.TracingKey = k break }