-
Notifications
You must be signed in to change notification settings - Fork 11.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ROCKETMQ-172]log improvement for rocketmq client #90
Conversation
2 similar comments
LGTM |
@@ -577,12 +577,12 @@ public void operationComplete(ResponseFuture responseFuture) { | |||
} | |||
} else { | |||
if (!responseFuture.isSendRequestOK()) { | |||
pullCallback.onException(new MQClientException("send request failed", responseFuture.getCause())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace {} with +
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this is not a sl4j 's logging, it's a exception, so direct string is needed.
2 similar comments
@@ -577,12 +577,12 @@ public void operationComplete(ResponseFuture responseFuture) { | |||
} | |||
} 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about writing it this way?
new MQClientException("send request [" + request+ "] failed to " + addr, responseFuture.getCause())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or ".request: " -> ". Request: "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would modify the typo , your NO2. advice
} 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" request: " -> ", request: "
@@ -321,6 +321,7 @@ public void updateNameServerAddressList(List<String> addrs) { | |||
|
|||
if (update) { | |||
Collections.shuffle(addrs); | |||
log.info("name server address updated. NEW : {} , OLD: {}",addrs,old); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a suggestion to make it prettier ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
+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.