[#7282] improvement(logging): use SLF4J formatting for alter table logs#7294
Merged
justinmclean merged 1 commit intoapache:mainfrom May 29, 2025
Merged
Conversation
vishnu-chalil
pushed a commit
to vishnu-chalil/gravitino
that referenced
this pull request
Jul 14, 2025
…ble logs (apache#7294) ### What changes were proposed in this pull request? Replaced string Concatenation in SLF4J `LOG.info` statement with built-in formatting in the following files: 1. `catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/operation/DorisTableOperations.java` 2. `catalogs/catalog-jdbc-mysql/src/main/java/org/apache/gravitino/catalog/mysql/operation/MysqlTableOperations.java` 3. `catalogs/catalog-jdbc-oceanbase/src/main/java/org/apache/gravitino/catalog/oceanbase/operation/OceanBaseTableOperations.java` ### Why are the changes needed? Using built-in formatting can help in: 1. It Enables **Lazy Evaluation**, ie, the string will not be constructed if the log is turned off. 2. Improves **consistency** and **best practice** throughout the codebase. 3. avoids concatenation overhead at runtime. This change was requested in Issue Number apache#7282. ### Does this PR introduce _any_ user-facing change? No, It does not introduce any user-facing change as it only affects internal logging behavior. ### How was this patch tested? As this is a logging improvement, no new test cases were added. The change is simple and syntactic. However, the affected classes still compile and retain the intended logging output.
hdygxsj
pushed a commit
to hdygxsj/gravitino
that referenced
this pull request
Jul 15, 2025
…ble logs (apache#7294) ### What changes were proposed in this pull request? Replaced string Concatenation in SLF4J `LOG.info` statement with built-in formatting in the following files: 1. `catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/operation/DorisTableOperations.java` 2. `catalogs/catalog-jdbc-mysql/src/main/java/org/apache/gravitino/catalog/mysql/operation/MysqlTableOperations.java` 3. `catalogs/catalog-jdbc-oceanbase/src/main/java/org/apache/gravitino/catalog/oceanbase/operation/OceanBaseTableOperations.java` ### Why are the changes needed? Using built-in formatting can help in: 1. It Enables **Lazy Evaluation**, ie, the string will not be constructed if the log is turned off. 2. Improves **consistency** and **best practice** throughout the codebase. 3. avoids concatenation overhead at runtime. This change was requested in Issue Number apache#7282. ### Does this PR introduce _any_ user-facing change? No, It does not introduce any user-facing change as it only affects internal logging behavior. ### How was this patch tested? As this is a logging improvement, no new test cases were added. The change is simple and syntactic. However, the affected classes still compile and retain the intended logging output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Replaced string Concatenation in SLF4J
LOG.infostatement with built-in formatting in the following files:catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/operation/DorisTableOperations.javacatalogs/catalog-jdbc-mysql/src/main/java/org/apache/gravitino/catalog/mysql/operation/MysqlTableOperations.javacatalogs/catalog-jdbc-oceanbase/src/main/java/org/apache/gravitino/catalog/oceanbase/operation/OceanBaseTableOperations.javaWhy are the changes needed?
Using built-in formatting can help in:
This change was requested in Issue Number #7282.
Does this PR introduce any user-facing change?
No, It does not introduce any user-facing change as it only affects internal logging behavior.
How was this patch tested?
As this is a logging improvement, no new test cases were added. The change is simple and syntactic.
However, the affected classes still compile and retain the intended logging output.