[ROCKETMQ-172]log improvement for rocketmq client#90
Conversation
2 similar comments
|
LGTM |
| } | ||
| } else { | ||
| if (!responseFuture.isSendRequestOK()) { | ||
| pullCallback.onException(new MQClientException("send request failed", responseFuture.getCause())); |
There was a problem hiding this comment.
But this is not a sl4j 's logging, it's a exception, so direct string is needed.
2 similar comments
| } else { | ||
| if (!responseFuture.isSendRequestOK()) { | ||
| pullCallback.onException(new MQClientException("send request failed", responseFuture.getCause())); | ||
| pullCallback.onException(new MQClientException("send request failed to " + addr + ".request: " + request, responseFuture.getCause())); |
There was a problem hiding this comment.
How about writing it this way?
new MQClientException("send request [" + request+ "] failed to " + addr, responseFuture.getCause())
There was a problem hiding this comment.
Or ".request: " -> ". Request: "
There was a problem hiding this comment.
I would modify the typo , your NO2. advice
| pullCallback.onException(new MQClientException("send request failed to " + addr + ".request: " + request, responseFuture.getCause())); | ||
| } else if (responseFuture.isTimeout()) { | ||
| pullCallback.onException(new MQClientException("wait response timeout " + responseFuture.getTimeoutMillis() + "ms", | ||
| pullCallback.onException(new MQClientException("wait response from " + addr + " timeout :" + responseFuture.getTimeoutMillis() + "ms" + " request: " + request, |
There was a problem hiding this comment.
" request: " -> ", request: "
|
|
||
| if (update) { | ||
| Collections.shuffle(addrs); | ||
| log.info("name server address updated. NEW : {} , OLD: {}",addrs,old); |
There was a problem hiding this comment.
NEW, OLD look ugly to me :)
How about
log.info("name server address updated from [{}] to [{}]", addrs, old);
?
There was a problem hiding this comment.
@shroman , but OLD , NEW has been already exists in rocketmq's log. please see ConsumerGroupInfo.java for one sample.
There was a problem hiding this comment.
just a suggestion to make it prettier ;)
There was a problem hiding this comment.
Perhaps we can post another PR for some logging format, currently I would just retain the current way
2 similar comments
2 similar comments
|
@shroman Please review again |
|
+1 |
|
LGTM +1 |
|
@Jaskey This PR has been merged |
|
@dongeforever @vongosling @shroman Thank you guys! |
[ISSUE #22] codeCov for mqtt.cs.session
JIRA: https://issues.apache.org/jira/browse/ROCKETMQ-172?jql=project%20%3D%20ROCKETMQ
This should be a pr which contains many improvement among the client code fragment.
@lizhanhui @shroman @vongosling @zhouxinyu
Please help pointing out more places where log/message should be improved.