Update to use String format and Object varargs

This commit is contained in:
rob
2023-02-14 14:54:23 +13:00
parent 9720cd8189
commit 2c8ae16179
25 changed files with 80 additions and 84 deletions
@@ -2,6 +2,7 @@ package io.ebean.test;
import io.ebeaninternal.api.SpiLogger;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
@@ -24,11 +25,11 @@ final class CaptureLogger implements SpiLogger {
}
@Override
public void debug(String msg) {
public void debug(String msg, Object... args) {
if (active) {
messages.add(msg);
messages.add(MessageFormat.format(msg, args));
}
wrapped.debug(msg);
wrapped.debug(msg, args);
}
List<String> start() {
@@ -5,7 +5,6 @@ import io.ebeaninternal.api.SpiLogger;
import io.ebeaninternal.api.SpiLoggerFactory;
import static java.lang.System.Logger.Level.DEBUG;
import static java.lang.System.Logger.Level.TRACE;
/**
* Create a logger that captures the SQL and register it for later access in tests.
@@ -38,9 +37,8 @@ public class CapturingLoggerFactory implements SpiLoggerFactory {
}
@Override
public void debug(String msg) {
logger.log(DEBUG, msg);
public void debug(String msg, Object... args) {
logger.log(DEBUG, msg, args);
}
}
}