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

[core] Rework slf4j reinitialization #4567

Merged
merged 1 commit into from
May 22, 2023

Conversation

adangel
Copy link
Member

@adangel adangel commented May 20, 2023

Describe the PR

This is necessary to fix the integration test "MPMD-244-logging" for maven.

  • Support also subclasses of slf4j-simple: e.g. maven uses an own logger factory and own loggers
  • Determine the new log level by reevaluating the configuration, similar what the constructors did
  • Remove unnecessary PmdLoggerFactoryFriend. The reset function is useless, as the logger instances are static fields in the individual classes, so clearing the loggerMap doesn't help.

This change didn't break any existing unit tests, so I assume, the switch between "--debug" and normal logging still works. I've verified it locally with the maven-pmd-plugin that logging can now be enabled/disabled by the plugin.

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

- Support also subclasses of slf4j-simple: e.g. maven uses an own logger factory and own loggers
- Determine the new log level by reevaluating the configuration, similar what the constructors did
- Remove unnecessary PmdLoggerFactoryFriend
@adangel adangel added this to the 7.0.0 milestone May 20, 2023
@pmd-test
Copy link

1 Message
📖 Compared to master:
This changeset changes 7 violations,
introduces 1 new violations, 0 new errors and 0 new configuration errors,
removes 1 violations, 0 errors and 0 configuration errors.
Full report

Generated by 🚫 Danger

@jsotuyod jsotuyod merged commit 68db058 into pmd:master May 22, 2023
3 checks passed
@adangel adangel deleted the slf4j-logging-reconfiguration branch May 26, 2023 08:30
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.

None yet

3 participants