Hello.

The java.util.function.Supplier is supported from Java 8.

Some new methods like:


public void debug(String format, Supplier<Object> argument);

public void debug(String format, Supplier<Object>... arguments);

may add to org.slf4j.Logger.

Lazy computing improves performance.

Old:

log.info("INFO a {} b {}",JsonUtil.ObjectToJson(instance),"success");

New:


log.info("INFO a {} b {}",()->JsonUtil.ObjectToJson(instance),"success");

The new one with better performance because the ObjectToJson called only on the 
info level or high.

I found slf4j support jdk version older the 8. Maybe we can create a new module 
for JDK 8. Supplier on slf4j is really an exciting feature.

Thanks!
_______________________________________________
slf4j-dev mailing list
slf4j-dev@qos.ch
http://mailman.qos.ch/mailman/listinfo/slf4j-dev

Reply via email to