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

Minor change to avoid getLevel to return null #236

Closed

Conversation

elifazio
Copy link

I have got a legacy project that access log4j api directly and does not expect to receive null on getLevel method. So I made a little change on version 1.7.30 to return effective level on getLevel, this avoid nullpointer on the legacy project.

@prdoyle
Copy link

prdoyle commented Nov 3, 2023

Please don't do this. If you want the effective level, call getEffectiveLevel. My project needs to know whether a level was explicitly set.

@ceki
Copy link
Member

ceki commented Nov 3, 2023

Thank you for the PR. Category.getLevel is meant to return the set level for the category/logger. Returning effective level from Category.getLevel would be semantically incorrect.

More importantly, log4j-over-slf4j is not indented as a full replacement for log4j functionality but only as a stop-measure.

@ceki ceki closed this Nov 3, 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

Successfully merging this pull request may close these issues.

None yet

3 participants