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

Incorrect handling of vararg Parameters #2

Open
moldowan opened this issue Oct 15, 2014 · 1 comment
Open

Incorrect handling of vararg Parameters #2

moldowan opened this issue Oct 15, 2014 · 1 comment

Comments

@moldowan
Copy link

When you log with vargargs (more than two parameters) org.slf4j.impl.Slf4jAdapter replaces the first placeholder with all values, all other placeholders remain un-replaced.
E.g.:
info("1: {} 2: {} 3: {}", "a", "b", "c")
results in
"1: [a, b, c] 2: {} 3: {}"
instead of
"1: a 2: b 3: c"

This is caused by org.slf4j.impl.Slf4jAdapter.format(String, Object[]), line 373.
Simply use org.slf4j.helpers.MessageFormatter.arrayFormat(String, Object) instead of MessageFormatter.format(String, Object).

@yegor256
Copy link
Member

thanks for reporting! I'll fix it today

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

No branches or pull requests

2 participants