Skip to content

The core.Logger#setLevel method should work like - #2282

Merged
garydgregory merged 2 commits into
apache:2.xfrom
garydgregory:2.x-issue-2281
Feb 14, 2024
Merged

garydgregory merged 2 commits into
apache:2.xfrom
garydgregory:2.x-issue-2281

Conversation

@garydgregory

Copy link
Copy Markdown
Member

The core.Logger#setLevel method should work like Configurator#setLevel #2281

@ppkarwasz

I'm not sure how to really test this from our 1.2 module but I did install a snapshot locally and tested it with my Apache Commons Logging branch here https://github.com/garydgregory/commons-logging/tree/log4j1-log42-api

The POM change to apache-rat-plugin was required for mvn clean verify to pass locally.

@ppkarwasz ppkarwasz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we simply test that setting a new level on a "foo" logger changes the effective level on a "foo.bar" logger?

Comment thread pom.xml
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>0.16.1</version>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should bump this in logging-parent if necessary or even better in the ASF parent: apache/maven-apache-parent#193

@ppkarwasz

Copy link
Copy Markdown
Member

BTW: you should also add a file in src/changelog/.2.x.x.

@vy vy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we add a test too, please?

@vy vy added bug Incorrect, unexpected, or unintended behavior of existing code api Affects the public API labels Feb 13, 2024
@garydgregory

garydgregory commented Feb 13, 2024 •

Copy link
Copy Markdown
Member Author

I added tests but they fail. I can't tell if the issue is in main or the test itself... See LoggerTest's new testSetLevel() and testSetPriority()

@garydgregory

Copy link
Copy Markdown
Member Author

TY @ppkarwasz !

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

Labels

api Affects the public API bug Incorrect, unexpected, or unintended behavior of existing code legacy-1.2-bridge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants