Skip to content

[#7282] improvement(logging): use SLF4J formatting for alter table logs#7294

Merged
justinmclean merged 1 commit intoapache:mainfrom
aaryansinhaa:fix/slf4j-logging-format
May 29, 2025
Merged

[#7282] improvement(logging): use SLF4J formatting for alter table logs#7294
justinmclean merged 1 commit intoapache:mainfrom
aaryansinhaa:fix/slf4j-logging-format

Conversation

@aaryansinhaa
Copy link
Contributor

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 #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.

Copy link
Member

@justinmclean justinmclean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing that.

@justinmclean justinmclean merged commit b6758ac into apache:main May 29, 2025
30 checks passed
@aaryansinhaa aaryansinhaa deleted the fix/slf4j-logging-format branch May 31, 2025 06:15
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants