nodece commented on code in PR #25536:
URL: https://github.com/apache/pulsar/pull/25536#discussion_r3091345822
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java:
##########
@@ -1214,8 +1213,12 @@ public void
testActiveAndInActiveConsumerEntryCacheBehavior() throws Exception {
// Make the test fail if there's a cache miss
pulsarTestContext.getMockBookKeeper().setReadHandleInterceptor((ledgerId,
firstEntry, lastEntry, entries) -> {
- log.error("Attempting to read from BK when cache should be used.
{}:{} to {}:{}", ledgerId, firstEntry,
- ledgerId, lastEntry);
+ log.error()
+ .attr("used", ledgerId)
+ .attr("firstEntry", firstEntry)
+ .attr("ledgerId", ledgerId)
+ .attr("lastEntry", lastEntry)
+ .log("Attempting to read from BK when cache should be
used. : to");
Review Comment:
**Bug: `"used"` is a word from the message text, not the variable name. Also
`ledgerId` appears twice and the message text is garbled.**
Original SLF4J:
```java
log.error("Attempting to read from BK when cache should be used. {}:{} to
{}:{}", ledgerId, firstEntry, ledgerId, lastEntry);
```
Suggested fix:
```java
log.error()
.attr("ledgerId", ledgerId)
.attr("firstEntry", firstEntry)
.attr("lastEntry", lastEntry)
.log("Attempting to read from BK when cache should be used");
```
--
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]