You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "voonhous (via GitHub)" <gi...@apache.org> on 2026/07/03 17:40:26 UTC

[PR] refactor(common): use SLF4J parameterized logging instead of string c… [hudi]

voonhous opened a new pull request, #19158:
URL: https://github.com/apache/hudi/pull/19158

   …oncatenation
   
   Convert log string concatenation to {} placeholders across hudi-common. Mechanical and behavior-preserving. Notable manual handling:
   - ZookeeperTestService: pass e.toString() (not e) so the exception stays an inline message value instead of being peeled as the SLF4J stacktrace arg, preserving the existing 'ignore as expected' behavior.
   - ConfigUtils: drop redundant path.toString() in the parameterized arg.
   - JmxMetricsReporter: the message wraps the value in literal braces; written as "{port: {}}" so SLF4J fills the inner {} and keeps the outer braces.
   
   ### Describe the issue this Pull Request addresses
   
   <!-- Either describe the issue inline here with motivation behind the changes 
        (or) link to an issue by including `Closes #<issue-number>` for context. 
        If this PR includes changes to the storage format, public APIs,
        or has breaking changes, use `!` (e.g., feat!: ...) -->
   
   ### Summary and Changelog
   
   <!-- Short, plain-English summary of what users gain or what changed in behavior.
        Followed by a detailed log of all the changes. Highlight if any code was copied. -->
   
   ### Impact
   
   <!-- Describe any public API or user-facing feature change or any performance impact. -->
   
   ### Risk Level
   
   <!-- Accepted values: none, low, medium or high. Other than `none`, explain the risk.
        If medium or high, explain what verification was done to mitigate the risks. -->
   
   ### Documentation Update
   
   <!-- Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none".
   
   - The config description must be updated if new configs are added or the default value of the configs are changed.
   - Any new feature or user-facing change requires updating the Hudi website. Please follow the 
     [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make changes to the website. -->
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Enough context is provided in the sections above
   - [ ] Adequate tests were added if applicable
   


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor(common): use SLF4J parameterized logging instead of string concatenation [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19158:
URL: https://github.com/apache/hudi/pull/19158#issuecomment-4878899081

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5f0211cc391b20a83b59917d18c3b3d11034da04",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15161",
       "triggerID" : "5f0211cc391b20a83b59917d18c3b3d11034da04",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5f0211cc391b20a83b59917d18c3b3d11034da04 Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15161) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor(common): use SLF4J parameterized logging instead of string concatenation [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19158:
URL: https://github.com/apache/hudi/pull/19158#issuecomment-4878443766

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5f0211cc391b20a83b59917d18c3b3d11034da04",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15161",
       "triggerID" : "5f0211cc391b20a83b59917d18c3b3d11034da04",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5f0211cc391b20a83b59917d18c3b3d11034da04 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=15161) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor(common): use SLF4J parameterized logging instead of string concatenation [hudi]

Posted by "voonhous (via GitHub)" <gi...@apache.org>.
voonhous commented on code in PR #19158:
URL: https://github.com/apache/hudi/pull/19158#discussion_r3522943228


##########
hudi-common/src/test/java/org/apache/hudi/common/testutils/minicluster/ZookeeperTestService.java:
##########
@@ -217,7 +217,7 @@ private static boolean waitForServerUp(String hostname, int port, long timeout)
         }
       } catch (IOException e) {
         // ignore as this is expected
-        log.info("server " + hostname + ":" + port + " not up " + e);
+        log.info("server {}:{} not up {}", hostname, port, e.toString());

Review Comment:
   This one's intentional. `e` is the last argument and there are three `{}` placeholders. SLF4J's `MessageFormatter` treats a trailing `Throwable` as the stacktrace arg: it peels `e` off the substitution list, so bare `e` would leave the third `{}` unfilled in the message *and* append a full stack trace - on a path that is explicitly `// ignore as this is expected` and runs in a tight startup-polling retry loop.
   
   `e.toString()` forces it to a `String` so it stays a plain value for the third placeholder, matching the original inline output. Keeping as-is.
   



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor(common): use SLF4J parameterized logging instead of string concatenation [hudi]

Posted by "hudi-agent (via GitHub)" <gi...@apache.org>.
hudi-agent commented on code in PR #19158:
URL: https://github.com/apache/hudi/pull/19158#discussion_r3521281297


##########
hudi-common/src/test/java/org/apache/hudi/common/testutils/minicluster/ZookeeperTestService.java:
##########
@@ -217,7 +217,7 @@ private static boolean waitForServerUp(String hostname, int port, long timeout)
         }
       } catch (IOException e) {
         // ignore as this is expected
-        log.info("server " + hostname + ":" + port + " not up " + e);
+        log.info("server {}:{} not up {}", hostname, port, e.toString());

Review Comment:
   🤖 nit: the explicit `.toString()` call is redundant here — SLF4J's parameterized logging calls `toString()` on arguments internally, so `e` alone would produce the same output and reads more naturally.
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag quality.</i></sub>



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor(common): use SLF4J parameterized logging instead of string concatenation [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19158:
URL: https://github.com/apache/hudi/pull/19158#issuecomment-4878419775

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5f0211cc391b20a83b59917d18c3b3d11034da04",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "5f0211cc391b20a83b59917d18c3b3d11034da04",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5f0211cc391b20a83b59917d18c3b3d11034da04 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor(common): use SLF4J parameterized logging instead of string concatenation [hudi]

Posted by "voonhous (via GitHub)" <gi...@apache.org>.
voonhous merged PR #19158:
URL: https://github.com/apache/hudi/pull/19158


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org