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

Null inputs replaced #390

Closed
karstenspang opened this issue May 27, 2023 · 1 comment · Fixed by #394
Closed

Null inputs replaced #390

karstenspang opened this issue May 27, 2023 · 1 comment · Fixed by #394
Milestone

Comments

@karstenspang
Copy link

At least two places, nulls are replaced by other values:

  • When a LoggingEvent is constructed with arguments, nulls are replaced by Option.empty()
  • If a null value is inserted in the MDC, it replaced by the string "null".

I am not sure what was the rationale for implementing it like this. For the first case, it may beacuse the original author wanted to use the Guava ImmutableList. But it also seems that he had a dislike for null in general.
If you just compare logging events, the first has no impact, but if you are testing MDC functionality, the second could be annoying. In particular, the assertion failure message shows null in both the expected and the actual value.

I can quickly make a PR to change this if you think it is a good idea.

@valfirst
Copy link
Owner

not sure what impact will be, but let's try, please proceed with PR

karstenspang added a commit to karstenspang/slf4j-test that referenced this issue May 30, 2023
karstenspang added a commit to karstenspang/slf4j-test that referenced this issue May 30, 2023
@valfirst valfirst added this to the 3.0.0 milestone May 30, 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 a pull request may close this issue.

2 participants