chia7712 commented on code in PR #18393: URL: https://github.com/apache/kafka/pull/18393#discussion_r2029925512
########## storage/src/main/java/org/apache/kafka/storage/internals/log/LocalLog.java: ########## @@ -470,8 +470,8 @@ public FetchDataInfo read(long startOffset, return maybeHandleIOException( () -> "Exception while reading from " + topicPartition + " in dir " + dir.getParent(), () -> { - logger.trace("Reading maximum $maxLength bytes at offset {} from log with total length {} bytes", - startOffset, segments.sizeInBytes()); + logger.trace("Reading maximum {} bytes at offset {} from log with total length {} bytes", + maxLength, startOffset, segments.sizeInBytes()); Review Comment: nit: Since `segments.sizeInBytes()` iterates through all segments to calculate the size, consider adding an `isTraceEnabled` flag to avoid unnecessary loops when trace logging is disabled by default. @gongxuanzhang WDYT? -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org