mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Update to use String format and Object varargs
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user