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 real logger slf4j #179

Merged
merged 2 commits into from
Apr 6, 2024
Merged

Use real logger slf4j #179

merged 2 commits into from
Apr 6, 2024

Conversation

hazendaz
Copy link
Member

@hazendaz hazendaz commented Apr 6, 2024

fixes #176

Also has renovate file, ignore it. That is for me, due to not agreeing, I'm using renovate and this is a small trade off. Renovate is not on upstream but config file needed for me so I'm not fighting moving commit back and forth.

renovate bot and others added 2 commits April 5, 2024 19:30
** Because we only use this with maven and to be in line with maven, use 1.7.36 since that is what maven is still using.
@hazendaz hazendaz self-assigned this Apr 6, 2024
@hazendaz hazendaz merged commit 1eb2fe1 into revelc:main Apr 6, 2024
6 checks passed
@hazendaz hazendaz added this to the 0.4.0 milestone Apr 6, 2024
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
Copy link
Member

Choose a reason for hiding this comment

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

Why not use slf4j2?

Copy link
Member Author

Choose a reason for hiding this comment

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

Its based on maven logging which is slf4j 1 still. Since this is used in the formatter maven plugin it needs to align there. However, it could move to 2 here as long as we use caution on the formatter plugin to stick to 1. Not sure if this is used outside that plugin thus the reason to just use version 1.

Copy link
Member

Choose a reason for hiding this comment

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

So, this is just dependency convergence with one of the maven provided plugins, then? Does this cause an actual breakage in logging, or is this just being done "just in case"?

My concern here is that the logging framework provided by Maven is pretty opaque to plugins. There's no maven BOM containing provided libraries for us to import, which would make this a lot more convenient. And there's no guarantee that any version of slf4j will be provided by Maven in each release. So, we really have to make assumptions, and that makes me uncomfortable.

One option is to keep using slf4j2 here, and leave the responsibility for dependency convergence between Maven and this library to the formatter-maven-plugin. The formatter-maven-plugin can add an exclusion for slf4j coming in transitively from this plugin, and it can declare slf4j with the correct version as provided from Maven.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm ok with making this module go to slf4j2 and just protecting on the plugin. That at least clears up concern here. On the plugin we are not providing any logging provider but we are using the apis. So it does matter there as slf4j completely changed their detection logic but agree that can be addressed there so this repo is cleaner since it doesn't matter here.

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.

Add slf4j api usage to this project
2 participants