[slf4j-dev] [Bug 70] " logging a stack trace along with a parameterized string" solution proposal

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Mon Mar 30 14:12:04 CEST 2009


http://bugzilla.slf4j.org/show_bug.cgi?id=70





--- Comment #15 from Joern Huxhorn <joern at huxhorn.de>  2009-03-30 14:12:03 ---
FYI, I've further enhanced my code in the meantime.

logger.debug("Argument {}", new String[]{"Foo", "Bar"});

will now result in the message

Argument [Foo, Bar]

instead of

Argument Foo

This means that there is special handling of a single placeholder.
If the last argument is *not* a Throwable *and* there is only a single
placeholder, the first argument will be the array itself and not the first
entry of the array.

Otherwise it would be necessary to write the above as
logger.debug("Argument {}", new Object[]{new String[]{"Foo", "Bar"}});
to get the desired result...

See also bug #112.

Comments?


-- 
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the slf4j-dev mailing list