Skip to content

Improve ConditionalLogger#6159

Merged
ctubbsii merged 1 commit intoapache:2.1from
ctubbsii:fix-slf4j-issues
Feb 27, 2026
Merged

Improve ConditionalLogger#6159
ctubbsii merged 1 commit intoapache:2.1from
ctubbsii:fix-slf4j-issues

Conversation

@ctubbsii
Copy link
Member

  • Use a smaller/simpler implementation
  • Do not rely on slf4j 2.0 APIs
  • Do not extend AbstractLogger or rely on its implementation
  • Replace BiFunction with BiPredicate
  • Avoid serialization issue flagged by Java 21 compiler where ConditionalLogger had a non-transient, non-serializable field (condition), which made ConditionalLogger not serializable, while extending AbstractLogger, which was serializable

* Use a smaller/simpler implementation
* Do not rely on slf4j 2.0 APIs
* Do not extend AbstractLogger or rely on its implementation
* Replace BiFunction with BiPredicate
* Avoid serialization issue flagged by Java 21 compiler where
  ConditionalLogger had a non-transient, non-serializable field
  (condition), which made ConditionalLogger not serializable, while
  extending AbstractLogger, which was serializable
@ctubbsii ctubbsii added this to the 2.1.5 milestone Feb 26, 2026
@ctubbsii ctubbsii requested a review from dlmarion February 26, 2026 23:22
Copy link
Contributor

@dlmarion dlmarion left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@ctubbsii ctubbsii merged commit 7415a25 into apache:2.1 Feb 27, 2026
8 checks passed
@ctubbsii ctubbsii deleted the fix-slf4j-issues branch February 27, 2026 21:00
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.

2 participants