Just saw that the new java logging framework slf4j supports parametrized logs, like
log.info(“log this {} {} {} and {}”, 1,2,”three”,4);
More on http://www.catosplace.net/blogs/personal/?p=442
Enjoy
import org.junit.Test;
import org.junit.rules.TestName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LoggingTest {
@Rule public TestName name = new TestName();
final Logger logger =
LoggerFactory.getLogger(LoggingTest.class);
@Test
public void testA() {
logger.info("{} being run...", name.getMethodName());
}
@Test
public void testB() {
logger.info("{} being run...", name.getMethodName()); }
}
}