[slf4j-dev] Add a third parameter of the log API if possible

George Cao matrix3456 at gmail.com
Wed Apr 11 13:18:59 CEST 2012


Hi guys,

I use slf4j log API for long time, one thing i feel inconvenience about it
the default number of log API parameters is 2. For instance:
    public void warn(String format, Object arg1, Object arg2);

Usually i log something in the  'who did what, and result is what ' style.
e.g.
    LOG.info("User {} update post {}, result is {}", userId, postId, true);
but the max number of parameters of this API is 2, so i need to write it
like this:
   LOG.info("User {} update post {}, result is {}",new Object[]{ userId,
postId, true});

I think the number of parameters of this API should be 3 and 3 is the most
common cases for a meaning log info.

Is this true or what are your concerns when you design the APIs?

Best regards,

George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-dev/attachments/20120411/95f9d42d/attachment.html>


More information about the slf4j-dev mailing list