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

Make slf4j.provider constant public. #362

Closed
garretwilson opened this issue Nov 6, 2023 · 3 comments
Closed

Make slf4j.provider constant public. #362

garretwilson opened this issue Nov 6, 2023 · 3 comments

Comments

@garretwilson
Copy link

Good work @KengoTODA on SLF4J-450. Unfortunately the PROVIDER_PROPERTY_KEY constant is not public in LoggerFactory:

static final public String PROVIDER_PROPERTY_KEY = "slf4j.provider";

This is part of the official, documented API, so it's appropriate that it should be public. After all I might want to programmatically set the system property like this (see #361), for example in JUnit tests:

@BeforeAll
static void disableLogging() {
  System.setProperty("slf4j.provider", NOP_FallbackServiceProvider.class.getName());
}

If nobody has any objections, I can file a pull request for this.

@ceki
Copy link
Member

ceki commented Nov 7, 2023

@garretwilson No objections and I agree with your assessment. However, PROVIDER_PROPERTY_KEY is already public as can be seen in commit 2481810. Am I missing something?

@garretwilson
Copy link
Author

Huh, I don't know how I missed that. Maybe it was because I was just looking at the source code and was accustomed to see public as the first modifier. (See discussion on order at https://stackoverflow.com/a/16732059 .)

Let me try it again in my IDE …

@garretwilson
Copy link
Author

Well, duh, I even showed the source code in the description!! 🤦‍♂️

It was toward the end of the day, so I think I just missed it because I'm used to seeing public as the first modifier. And when I tried it in the IDE I must have accidentally used ILoggerFactory instead of LoggerFactory.

It seems I was mistaken. You can close this ticket as invalid. Thanks!

@ceki ceki closed this as completed Nov 14, 2023
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

No branches or pull requests

2 participants