Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Remove redundant logger name usage in SimpleFormatter #43631

Closed
wants to merge 1 commit into from

Conversation

minwoo1999
Copy link
Contributor

While reviewing the SimpleFormatter implementation, I noticed that the source variable and record.getLoggerName() always return the same value. However, the existing code passes both separately to the String.format method. This seemed redundant, so I made some changes to simplify the implementation.

What has been changed:

Updated the DEFAULT_FORMAT string to reuse source wherever the logger name is needed.
Refactored the format method to pass source just once, removing unnecessary duplication.

Why this change was made:

By reusing the source variable, the code becomes cleaner and easier to understand. It eliminates redundancy without affecting the functionality or output format. The log output remains exactly the same as before.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 30, 2024
@minwoo1999 minwoo1999 closed this Dec 30, 2024
@bclozel bclozel added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants