Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: print logs of registered providers and consumers #2320

Merged
merged 2 commits into from
Jun 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 (
ev1lQuark marked this conversation as resolved.
Show resolved Hide resolved
"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))
chickenlj marked this conversation as resolved.
Show resolved Hide resolved
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 (
ev1lQuark marked this conversation as resolved.
Show resolved Hide resolved
"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