mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Clientv3 (retry) logs should use the configured logger.
clientv3 logs (especially tests) were poluted with unattributed to testing.T log lines:
```
{"level":"warn","ts":"2021-04-29T12:42:11.055+0200","logger":"etcd-client","caller":"v3/retry_interceptor.go:64","msg":"retrying of unary invoker failed","target":"etcd-endpoints://0xc0000fafc0/#initially=[unix://localhost:m10]","attempt":0,"error":"rpc error: code = ResourceExhausted desc = etcdserver: mvcc: database space exceeded"}
```
The reasons were 2 fold:
- Interceptors were copying logger before "WithLogger" could modify it.
- We were not propagating the loggers in a few testing contexts.
This commit is contained in:
@@ -120,6 +120,7 @@ func epHealthCommandFunc(cmd *cobra.Command, args []string) {
|
||||
hch <- epHealth{Ep: ep, Health: false, Error: err.Error()}
|
||||
return
|
||||
}
|
||||
cli = cli.WithLogger(lg.Named("client"))
|
||||
st := time.Now()
|
||||
// get a random key. As long as we can get the response without an error, the
|
||||
// endpoint is health.
|
||||
|
||||
Reference in New Issue
Block a user