nodece commented on code in PR #25536:
URL: https://github.com/apache/pulsar/pull/25536#discussion_r3091369753
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadBalancerTest.java:
##########
@@ -708,18 +711,19 @@ public void testLeaderElection() throws Exception {
}
}
// Make sure all brokers see the same leader
- log.info("Old leader is : {}", oldLeader.getBrokerId());
+ log.info().attr("brokerId", oldLeader.getBrokerId()).log("Old
leader");
Review Comment:
**`"Old leader"` lost the "is" context from `"Old leader is : {}"` — the
message now reads ambiguously without the verb.**
```suggestion
log.info().attr("brokerId", oldLeader.getBrokerId()).log("Old
leader is");
```
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadBalancerTest.java:
##########
@@ -432,8 +433,10 @@ public void testTopicAssignmentWithExistingBundles()
throws Exception {
long expectedValue = expectedAssignments[i];
double variation = Math.abs(actualValue - expectedValue) * 100.0 /
expectedValue;
- log.info("Topic assignment - {}, actual: {}, expected baseline:
{}, variation: {}/%",
- lookupAddresses[i], actualValue, expectedValue,
String.format("%.2f", variation));
+ log.info().attr("address", lookupAddresses[i]).attr("actual",
actualValue)
+ .attr("expectedBaseline", expectedValue)
+ .attr("variation", String.format("%.2f", variation))
Review Comment:
**`"variation"` attr lost the `%` unit from the original `"variation: {}/%
"` message.**
Suggestion: rename the attr to make the unit self-documenting:
```suggestion
.attr("variationPct", String.format("%.2f", variation))
```
--
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]