Skip to content

Commit

Permalink
optimize log
Browse files Browse the repository at this point in the history
  • Loading branch information
weiqiang.fan committed Apr 26, 2024
1 parent f43e013 commit 89b2ed1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/service_xlayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ func (s *bridgeService) fillLogoInfos(ctx context.Context, transactionMap map[st
if !errors.Is(err, redis.Nil) {
log.Errorf("get token logo info failed, so use rpc to fetch, chainId: %v, token: %v, error: %v", v[0].FromChainId, v[0].BridgeToken, err)
}
log.Infof("token need to use rpc to get logo, token: %v, chainId: %v", v[0].BridgeToken, v[0].FromChainId)
noCacheTokenMap[v[0].FromChainId] = append(noCacheTokenMap[v[0].FromChainId], v[0].BridgeToken)
continue
}
Expand All @@ -589,11 +590,12 @@ func (s *bridgeService) fillLogoInfos(ctx context.Context, transactionMap map[st
logoParams := s.buildQueryLogoParams(noCacheTokenMap)
tokenLogoMap, err := tokenlogoinfo.GetClient().GetTokenLogoInfos(logoParams)
if err != nil {

Check failure on line 592 in server/service_xlayer.go

View workflow job for this annotation

GitHub Actions / lint

unnecessary leading newline (whitespace)
log.Errorf("get token logo infos by rpc failed, so skip these tokens: %v", logoParams)

log.Errorf("get token logo infos by rpc failed, so skip these tokens")
return
}
if tokenLogoMap == nil {
log.Infof("get token logo infos, but result is empty, so skip these tokens: %v", logoParams)
log.Infof("get token logo infos, but result is empty, so skip these tokens")
return
}
for k, v := range tokenLogoMap {
Expand Down

0 comments on commit 89b2ed1

Please sign in to comment.