Is there a Java 1.5 varargs API for slf4j yet?

2019-04-18 00:11发布

I want to get rid of this lot...

public void info(String msg);
public void info(String format, Object arg);
public void info(String format, Object arg1, Object arg2);
public void info(String format, Object[] argArray);

...and replace it with this one...

public void info(String format, Object ... args);

...so that my logging syntax doesn't have to change depending on the number of arguments I want to log. There seems to be lots of discussion and work around it, but where is it? Or should I wrap the wrapper that is slf4j?

7条回答
唯我独甜
2楼-- · 2019-04-18 00:55

Try jcabi-log toolkit, which wraps SLF4J logging with a conveninent vararg interface.

查看更多
登录 后发表回答