[#1437] node: Use ctx for logging
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
c16dae8b4d
commit
6db46257c0
157 changed files with 764 additions and 713 deletions
|
@ -42,7 +42,7 @@ func (c *Client) SwitchRPC(ctx context.Context) bool {
|
|||
newEndpoint := c.endpoints.list[c.endpoints.curr]
|
||||
cli, act, err := c.newCli(ctx, newEndpoint)
|
||||
if err != nil {
|
||||
c.logger.Warn(logs.ClientCouldNotEstablishConnectionToTheSwitchedRPCNode,
|
||||
c.logger.Warn(ctx, logs.ClientCouldNotEstablishConnectionToTheSwitchedRPCNode,
|
||||
zap.String("endpoint", newEndpoint.Address),
|
||||
zap.Error(err),
|
||||
)
|
||||
|
@ -52,7 +52,7 @@ func (c *Client) SwitchRPC(ctx context.Context) bool {
|
|||
|
||||
c.cache.invalidate()
|
||||
|
||||
c.logger.Info(logs.ClientConnectionToTheNewRPCNodeHasBeenEstablished,
|
||||
c.logger.Info(ctx, logs.ClientConnectionToTheNewRPCNodeHasBeenEstablished,
|
||||
zap.String("endpoint", newEndpoint.Address))
|
||||
|
||||
c.client = cli
|
||||
|
@ -122,7 +122,7 @@ mainLoop:
|
|||
|
||||
cli, act, err := c.newCli(ctx, e)
|
||||
if err != nil {
|
||||
c.logger.Warn(logs.ClientCouldNotCreateClientToTheHigherPriorityNode,
|
||||
c.logger.Warn(ctx, logs.ClientCouldNotCreateClientToTheHigherPriorityNode,
|
||||
zap.String("endpoint", tryE),
|
||||
zap.Error(err),
|
||||
)
|
||||
|
@ -147,7 +147,7 @@ mainLoop:
|
|||
|
||||
c.switchLock.Unlock()
|
||||
|
||||
c.logger.Info(logs.ClientSwitchedToTheHigherPriorityRPC,
|
||||
c.logger.Info(ctx, logs.ClientSwitchedToTheHigherPriorityRPC,
|
||||
zap.String("endpoint", tryE))
|
||||
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue