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

LoggingEvent#getFormattedMessage() doesn't format nulls the same way as SLF4J #220

Closed
josephw opened this issue Dec 23, 2021 · 1 comment · Fixed by #221
Closed

LoggingEvent#getFormattedMessage() doesn't format nulls the same way as SLF4J #220

josephw opened this issue Dec 23, 2021 · 1 comment · Fixed by #221

Comments

@josephw
Copy link

josephw commented Dec 23, 2021

LoggingEvent#getFormattedMessage() is public (#23). However, it doesn't present null values the same way as SLF4J, due to un-matched wrapping/unwrapping of Optional:

        LoggingEvent e = new LoggingEvent(Level.INFO, "Content: {}, {}", null, "value");
        System.out.println(e.getFormattedMessage());

Produces:

Content: Optional.empty, value

Rather than the expected:

Content: null, value

(Reposted from Mahoney#31)

@valfirst
Copy link
Owner

@josephw do you need a release for this fix?

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