nanjiek commented on code in PR #3311:
URL: https://github.com/apache/dubbo-go/pull/3311#discussion_r3158214721


##########
cluster/cluster/adaptivesvc/cluster_invoker.go:
##########
@@ -86,21 +86,21 @@ func (ivk *adaptiveServiceClusterInvoker) Invoke(ctx 
context.Context, invocation
                }
        }
        if remainingStr == "" {
-               logger.Errorf("[adasvc cluster] The %s field type of value %v 
should be string.",
-                       constant.AdaptiveServiceRemainingKey, remainingIface)
+               logger.Errorf("[AdaptiveSvc] %s field type invalid, key=%s 
value=%v",
+                       constant.AdaptiveServiceRemainingKey, 
constant.AdaptiveServiceRemainingKey, remainingIface)
                return res
        }
        remaining, err := strconv.Atoi(remainingStr)
        if err != nil {
-               logger.Warnf("the remaining is unexpected, we need a int type, 
but we got %s, err: %v.", remainingStr, err)
+               logger.Warnf("[AdaptiveSvc] parse remaining failed, 
remaining=%s err=%v", remainingStr, err)

Review Comment:
   这一部分改成expected + 类型比较好,不太好定位问题



##########
cluster/cluster/base/cluster_invoker.go:
##########
@@ -127,7 +127,7 @@ func (invoker *BaseClusterInvoker) doSelectInvoker(lb 
loadbalance.LoadBalance, i
                        return invokers[0]
                }
                base.SetInvokerUnhealthyStatus(invokers[0])
-               logger.Errorf("the invokers of %s is nil. ", 
invokers[0].GetURL().ServiceKey())
+               logger.Errorf("[Cluster] invoker unavailable, serviceKey=%s", 
invokers[0].GetURL().ServiceKey())

Review Comment:
   unavailable有很多种,不能定位到nil,最后后面加个解释
   ```suggestion
                logger.Errorf("[Cluster] invoker unavailable, serviceKey=%s, 
reason=nil", invokers[0].GetURL().ServiceKey())
   ```



##########
cluster/cluster/adaptivesvc/cluster_invoker.go:
##########
@@ -86,21 +86,21 @@ func (ivk *adaptiveServiceClusterInvoker) Invoke(ctx 
context.Context, invocation
                }
        }
        if remainingStr == "" {
-               logger.Errorf("[adasvc cluster] The %s field type of value %v 
should be string.",
-                       constant.AdaptiveServiceRemainingKey, remainingIface)
+               logger.Errorf("[AdaptiveSvc] %s field type invalid, key=%s 
value=%v",
+                       constant.AdaptiveServiceRemainingKey, 
constant.AdaptiveServiceRemainingKey, remainingIface)
                return res
        }
        remaining, err := strconv.Atoi(remainingStr)
        if err != nil {
-               logger.Warnf("the remaining is unexpected, we need a int type, 
but we got %s, err: %v.", remainingStr, err)
+               logger.Warnf("[AdaptiveSvc] parse remaining failed, 
remaining=%s err=%v", remainingStr, err)

Review Comment:
   ```suggestion
                logger.Errorf("[AdaptiveSvc] %s field type invalid, key=%s 
value=%v, expected string" ,
                        constant.AdaptiveServiceRemainingKey, 
constant.AdaptiveServiceRemainingKey, remainingIface)
   return res
   }
   remaining, err := strconv.Atoi(remainingStr)
   if err != nil {
                logger.Warnf("[AdaptiveSvc] parse remaining failed, 
remaining=%s err=%v, expected int" , remainingStr, err)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to