[slf4j-user] Message format - change from '{}' to '%s'

Ceki Gülcü listid at qos.ch
Tue Nov 21 20:36:15 CET 2006


Hi Michael,

At 01:58 AM 11/11/2006, Newcomb, Michael-P57487 wrote:
>Yes.
>
>And, you would just have to call String.format() to format the message:
>
>debug(String format, Object... args)
>{
>   if (isDebugEnabled())
>   {
>     String text = String.format(format, args);
>
>     impl.log(text); // or whatever...
>   }
>}

I see, the above is a potential implementation. OK.

>You could still support the old format with a property or something, but I 
>think moving to the format used by String.format() would be better than 
>switching back and forth:
>
>String fullyQualifiedName = String.format("%s.%s", packageName, className);
>log.debug("fullyQualifiedName = {}", fullyQualifiedName);

Forgive me if I am a little thick but what's wrong with:

log.debug("fullyQualifiedName = {}.{}", packageName, className);

What am I missing here?

>Thanks,
>Michael

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch




More information about the slf4j-user mailing list