Wednesday, August 10, 2022

SLF4J caveat on formatting

this will simply log NOTHING: in, the first parameter if it's a String it should be a formatting string, like "{}" .... if there is no format, nothing is logged.
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;
import java.util.List;

public class TestClass {
    public static void main(String[] args) {
        TestClass testClass = new TestClass();

    public void test() {
        Logger log = LoggerFactory.getLogger(this.getClass());
        List<String> responses = Arrays.asList("pippo", "pluto");"", responses);