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

Use SLF4J throughout plugin #1116

Closed
pdjohe opened this issue Feb 3, 2022 · 4 comments · Fixed by #1120
Closed

Use SLF4J throughout plugin #1116

pdjohe opened this issue Feb 3, 2022 · 4 comments · Fixed by #1120

Comments

@pdjohe
Copy link

pdjohe commented Feb 3, 2022

java.util.Logger is used in many places, but maven builds on SLF4J. The output from the plugin is inconsistent (for example, pom sorting).

[INFO] --- spotless-maven-plugin:2.20.1:check (default) @ parent-pom ---
[INFO] Up-to-date checking enabled
[INFO] Index file does not exist. Fallback to an empty index
Feb 03, 2022 1:24:36 PM com.diffplug.spotless.glue.pom.SortPomFormatterFunc$MySortPomLogger info
INFO: Sorting file ...\pom2973277670321689996.xml
Feb 03, 2022 1:24:37 PM com.diffplug.spotless.glue.pom.SortPomFormatterFunc$MySortPomLogger info
INFO: Pom file is already sorted, exiting
[INFO] 

All places in the code could be updated to use SLF4J's Logger instead.

Gradle looks like that framework builds on SLF4J too: https://docs.gradle.org/current/javadoc/org/gradle/api/logging/Logger.html

@nedtwigg
Copy link
Member

nedtwigg commented Feb 3, 2022

Happy to take a PR for this.

@jamietanna
Copy link
Contributor

@pdjohe did you want to pick this up? I've had a look at it and if you don't fancy it, I can pick it up 😄

@pdjohe
Copy link
Author

pdjohe commented Feb 5, 2022

@jamietanna : it's all yours! 😄 Happy coding!

jamietanna added a commit to jamietanna/spotless that referenced this issue Feb 6, 2022
As noted in diffplug#1116, it'd be ideal if we moved to SLF4J as our logging
interface.

We can do this pretty easily, making sure we remove our `package-list`
reference, as well as making sure the SLF4J API is only used for
compilation.

We also need to map the error logging levels that most closely mirror
what `java.util.logging` uses.

Closes diffplug#1116.
jamietanna added a commit to jamietanna/spotless that referenced this issue Feb 15, 2022
As noted in diffplug#1116, it'd be ideal if we moved to SLF4J as our logging
interface.

We can do this pretty easily, making sure we remove our `package-list`
reference, as well as making sure the SLF4J API is only used for
compilation.

We also need to map the error logging levels that most closely mirror
what `java.util.logging` uses.

Closes diffplug#1116.
@nedtwigg
Copy link
Member

Published in plugin-gradle 6.3.0, not enough new features to justify a maven release yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants