This is an automated email from the ASF dual-hosted git repository.
dmwangnima pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/main by this push:
new 8997917fc fix(log): logger formatting (#2640)
8997917fc is described below
commit 8997917fc9e24292f5b8fa424e1634c4b83212a3
Author: KamTo Hung <[email protected]>
AuthorDate: Mon Mar 18 21:40:39 2024 +0800
fix(log): logger formatting (#2640)
---
config_center/nacos/client.go | 2 +-
registry/zookeeper/registry.go | 2 +-
remoting/etcdv3/client.go | 12 ++++++------
remoting/zookeeper/client.go | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/config_center/nacos/client.go b/config_center/nacos/client.go
index 52850115b..a13865e74 100644
--- a/config_center/nacos/client.go
+++ b/config_center/nacos/client.go
@@ -67,7 +67,7 @@ func ValidateNacosClient(container nacosClientFacade) error {
// in dubbo ,every registry only connect one node ,so this is
[]string{r.Address}
newClient, err := nacos.NewNacosConfigClientByUrl(url)
if err != nil {
- logger.Errorf("ValidateNacosClient(name{%s}, nacos
address{%v} = error{%v}", url.Location, err)
+ logger.Errorf("ValidateNacosClient(nacos address{%v} =
error{%v}", url.Location, err)
return perrors.WithMessagef(err,
"newNacosClient(address:%+v)", url.Location)
}
container.SetNacosClient(newClient)
diff --git a/registry/zookeeper/registry.go b/registry/zookeeper/registry.go
index 3b2675132..a743f71a8 100644
--- a/registry/zookeeper/registry.go
+++ b/registry/zookeeper/registry.go
@@ -306,7 +306,7 @@ func (r *zkRegistry) getCloseListener(conf *common.URL)
(*RegistryConfigurationL
if configurationListener := r.dataListener.UnSubscribeURL(conf);
configurationListener != nil {
switch v := configurationListener.(type) {
- case (*RegistryConfigurationListener):
+ case *RegistryConfigurationListener:
if v != nil {
zkListener = v
}
diff --git a/remoting/etcdv3/client.go b/remoting/etcdv3/client.go
index 76a41ef79..86ff77f05 100644
--- a/remoting/etcdv3/client.go
+++ b/remoting/etcdv3/client.go
@@ -38,8 +38,8 @@ func ValidateClient(container clientFacade, opts
...gxetcd.Option) error {
if container.Client() == nil {
newClient, err := gxetcd.NewClient(options.Name,
options.Endpoints, options.Timeout, options.Heartbeat)
if err != nil {
- logger.Warnf("new etcd client (name{%s}, etcd
addresses{%v}, timeout{%d}) = error{%v}",
- options.Name, options.Endpoints,
options.Timeout, err)
+ logger.Warnf("new etcd client (name{%s}, etcd
addresses{%v}, timeout{%s}) = error{%v}",
+ options.Name, options.Endpoints,
options.Timeout.String(), err)
return perrors.WithMessagef(err, "new client
(address:%+v)", options.Endpoints)
}
container.SetClient(newClient)
@@ -49,8 +49,8 @@ func ValidateClient(container clientFacade, opts
...gxetcd.Option) error {
if container.Client().GetRawClient() == nil {
newClient, err := gxetcd.NewClient(options.Name,
options.Endpoints, options.Timeout, options.Heartbeat)
if err != nil {
- logger.Warnf("new etcd client (name{%s}, etcd
addresses{%v}, timeout{%d}) = error{%v}",
- options.Name, options.Endpoints,
options.Timeout, err)
+ logger.Warnf("new etcd client (name{%s}, etcd
addresses{%v}, timeout{%s}) = error{%v}",
+ options.Name, options.Endpoints,
options.Timeout.String(), err)
return perrors.WithMessagef(err, "new client
(address:%+v)", options.Endpoints)
}
container.SetClient(newClient)
@@ -70,8 +70,8 @@ func NewServiceDiscoveryClient(opts ...gxetcd.Option)
*gxetcd.Client {
newClient, err := gxetcd.NewClient(options.Name, options.Endpoints,
options.Timeout, options.Heartbeat)
if err != nil {
- logger.Errorf("new etcd client (name{%s}, etcd addresses{%v},
timeout{%d}) = error{%v}",
- options.Name, options.Endpoints, options.Timeout, err)
+ logger.Errorf("new etcd client (name{%s}, etcd addresses{%v},
timeout{%s}) = error{%v}",
+ options.Name, options.Endpoints,
options.Timeout.String(), err)
}
return newClient
}
diff --git a/remoting/zookeeper/client.go b/remoting/zookeeper/client.go
index 155f9193d..0bd22b774 100644
--- a/remoting/zookeeper/client.go
+++ b/remoting/zookeeper/client.go
@@ -53,7 +53,7 @@ func ValidateZookeeperClient(container ZkClientFacade, zkName
string) error {
logger.Infof("[Zookeeper Client] New zookeeper client with name
= %s, zkAddress = %s, timeout = %s", zkName, url.Location, timeout.String())
newClient, cltErr := gxzookeeper.NewZookeeperClient(zkName,
zkAddresses, true, gxzookeeper.WithZkTimeOut(timeout))
if cltErr != nil {
- logger.Warnf("newZookeeperClient(name{%s}, zk
address{%v}, timeout{%d}) = error{%v}",
+ logger.Warnf("newZookeeperClient(name{%s}, zk
address{%v}, timeout{%s}) = error{%v}",
zkName, url.Location, timeout.String(), cltErr)
return perrors.WithMessagef(cltErr,
"newZookeeperClient(address:%+v)", url.Location)
}