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...
  }
} 

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);

Thanks,
Michael

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Gilday
Sent: Friday, November 10, 2006 5:18 PM
To: User list for the slf4j project
Subject: Re: [slf4j-user] Message format - change from '{}' to '%s'

I assume he means like the java 5 System.out.printf.  This would be a more 
complex than the current system, but you gain the power of being able to format 
and reuse fields (as they are indexed) within your logging statement.  This 
would take the varargs addition to the next level.


----- Original message -----
From: "Ceki Gülcü" <[EMAIL PROTECTED]>
To: "User list for the slf4j project" <[email protected]>
Date: Fri, 10 Nov 2006 22:41:41 +0100
Subject: Re: [slf4j-user] Message format - change from '{}' to '%s'

At 02:44 PM 11/10/2006, you wrote:

>As SLF4J moves to Java 5, I would suggest you also change from using '{}' 
>to the formatted string style '%s' etc&#8230;

Hi Michael,

Would you care to expand on the question?

>Thanks,
>Michael

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

_______________________________________________
user mailing list
[email protected]
http://www.slf4j.org/mailman/listinfo/user
_______________________________________________
user mailing list
[email protected]
http://www.slf4j.org/mailman/listinfo/user
_______________________________________________
user mailing list
[email protected]
http://www.slf4j.org/mailman/listinfo/user

Reply via email to