Skip to content

Commit

Permalink
feat: print logs of registered providers and consumers
Browse files Browse the repository at this point in the history
  • Loading branch information
ev1lQuark committed May 30, 2023
1 parent 9cf1b9f commit 0d795bb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion config/consumer_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package config

import (
"fmt"
"strings"
"time"
)

Expand Down Expand Up @@ -65,12 +66,19 @@ func (cc *ConsumerConfig) Init(rc *RootConfig) error {
if cc == nil {
return nil
}

consumerNames := make([]string, 0, len(cc.References))
for k := range cc.References {
consumerNames = append(consumerNames, k)
}
logger.Debugf("Registered consumer clients are %v", strings.Join(consumerNames, ", "))

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
}
Expand Down
10 changes: 9 additions & 1 deletion config/provider_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package config

import (
"fmt"
"strings"
)

import (
Expand Down Expand Up @@ -75,14 +76,21 @@ func (c *ProviderConfig) Init(rc *RootConfig) error {
if c == nil {
return nil
}

providerNames := make([]string, 0, len(c.Services))
for k := range c.Services {
providerNames = append(providerNames, k)
}
logger.Debugf("Registered provider services are %v", strings.Join(providerNames, ", "))

c.RegistryIDs = translateIds(c.RegistryIDs)
if len(c.RegistryIDs) <= 0 {
c.RegistryIDs = rc.getRegistryIds()
}
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
}
Expand Down

0 comments on commit 0d795bb

Please sign in to comment.