Skip to content
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

Closed
wants to merge 5 commits into from
Closed

[ROCKETMQ-172]log improvement for rocketmq client #90

wants to merge 5 commits into from

Conversation

Jaskey
Copy link
Contributor

@Jaskey Jaskey commented Apr 11, 2017

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.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 31.855% when pulling 633ac28 on Jaskey:ROCKETMQ-172-log-improvement into a8fa05e on apache:develop.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 31.855% when pulling 633ac28 on Jaskey:ROCKETMQ-172-log-improvement into a8fa05e on apache:develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 31.855% when pulling 633ac28 on Jaskey:ROCKETMQ-172-log-improvement into a8fa05e on apache:develop.

@vesense
Copy link
Member

vesense commented Apr 13, 2017

LGTM

@@ -577,12 +577,12 @@ public void operationComplete(ResponseFuture responseFuture) {
}
} else {
if (!responseFuture.isSendRequestOK()) {
pullCallback.onException(new MQClientException("send request failed", responseFuture.getCause()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace {} with +

Copy link
Contributor Author

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.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.8%) to 34.664% when pulling 7909245 on Jaskey:ROCKETMQ-172-log-improvement into a8fa05e on apache:develop.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+2.8%) to 34.664% when pulling 7909245 on Jaskey:ROCKETMQ-172-log-improvement into a8fa05e on apache:develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.8%) to 34.664% when pulling 7909245 on Jaskey:ROCKETMQ-172-log-improvement into a8fa05e on apache:develop.

@coveralls
Copy link

coveralls commented Apr 14, 2017

Coverage Status

Coverage increased (+2.8%) to 34.604% when pulling c46e4c6 on Jaskey:ROCKETMQ-172-log-improvement into a8fa05e on apache:develop.

@@ -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()));
Copy link
Contributor

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())

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or ".request: " -> ". Request: "

Copy link
Contributor Author

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,
Copy link
Contributor

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);
Copy link
Contributor

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);

?

Copy link
Contributor Author

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.

Copy link
Contributor

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 ;)

Copy link
Contributor Author

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

@coveralls
Copy link

Coverage Status

Coverage increased (+2.7%) to 34.586% when pulling ec7c8cd on Jaskey:ROCKETMQ-172-log-improvement into a8fa05e on apache:develop.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+2.7%) to 34.586% when pulling ec7c8cd on Jaskey:ROCKETMQ-172-log-improvement into a8fa05e on apache:develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.7%) to 34.586% when pulling ec7c8cd on Jaskey:ROCKETMQ-172-log-improvement into a8fa05e on apache:develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.7%) to 34.492% when pulling 1e8b575 on Jaskey:ROCKETMQ-172-log-improvement into a8fa05e on apache:develop.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+2.7%) to 34.492% when pulling 1e8b575 on Jaskey:ROCKETMQ-172-log-improvement into a8fa05e on apache:develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.7%) to 34.492% when pulling 1e8b575 on Jaskey:ROCKETMQ-172-log-improvement into a8fa05e on apache:develop.

@Jaskey
Copy link
Contributor Author

Jaskey commented Apr 17, 2017

@shroman Please review again

Copy link
Contributor

@shroman shroman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@vongosling
Copy link
Member

+1

@dongeforever
Copy link
Member

LGTM +1

@dongeforever
Copy link
Member

@Jaskey This PR has been merged

@Jaskey
Copy link
Contributor Author

Jaskey commented Apr 17, 2017

@dongeforever @vongosling @shroman

Thank you guys!

@Jaskey Jaskey closed this Apr 17, 2017
@Jaskey Jaskey deleted the ROCKETMQ-172-log-improvement branch April 17, 2017 12:27
JiaMingLiu93 pushed a commit to JiaMingLiu93/rocketmq that referenced this pull request May 28, 2020
JiaMingLiu93 pushed a commit to JiaMingLiu93/rocketmq that referenced this pull request May 28, 2020
pingww pushed a commit that referenced this pull request Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants