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

Parameterize SLF4J's logging statements #1617

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

stephanr
Copy link
Member

@stephanr stephanr commented Dec 7, 2023

The current codebase does not follow the recommendation way of using SLF4J parametrized logging.

This was done, as it is good practice and also boosts performance when the log statement is called often and is not configured to be logged.

With the help of automated rewriting, this was corrected for all cases that could be changed automatically.
The folder deegree-core/deegree-core-geometry/src/test/java/org/deegree/geometry/linearization was reviewed and fixed manually, as the automated tool had problems with the test cases.

Besides this PR, I would also suggest extending the chapter "Logging" in the wiki (https://github.com/deegree/deegree3/wiki/Developer-Guidelines#logging)


Following good practices, we would like to encourage deegree developers to use parametrized logging whenever possible.

LOG.debug("The new entry is {}. It replaces {}.", entry, oldEntry);

This speeds up logging when the requested level is turned off, for example. It also makes it easier to find messages in the source tree or to filter logging during runtime.

For more details, see https://www.slf4j.org/faq.html#logging_performance


@stephanr stephanr added enhancement enhancement or improvement core deegree core modules labels Dec 7, 2023
@stephanr stephanr added this to the 3.6 milestone Dec 7, 2023
@stephanr stephanr self-assigned this Dec 8, 2023
@stephanr stephanr requested review from tfr42 and copierrj December 8, 2023 08:16
@tfr42 tfr42 merged commit 4a715f7 into deegree:main Dec 13, 2023
1 check passed
@stephanr stephanr deleted the enhancement/code-cleanup-slf4j-logging branch December 13, 2023 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core deegree core modules enhancement enhancement or improvement
Projects
Development

Successfully merging this pull request may close these issues.

2 participants