mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-23 15:12:58 +00:00
#1402 - Refactor SQL Logging internals (io.ebean.SQL) such that it is easier to capture for testing/asserts
This commit is contained in:
commit
3f8d705439
22 files changed
+305
-131
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package io.ebeantest;
|
||||
|
||||
import io.ebeaninternal.api.SpiLogger;
|
||||
import io.ebeaninternal.server.log.DSpiLogger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LoggedSql {
|
||||
|
||||
private static CaptureLogger sqlLogger;
|
||||
|
||||
static SpiLogger register(DSpiLogger logger) {
|
||||
if (sqlLogger == null) {
|
||||
sqlLogger = new CaptureLogger(logger);
|
||||
}
|
||||
return sqlLogger;
|
||||
}
|
||||
|
||||
public static List<String> start() {
|
||||
return sqlLogger.start();
|
||||
}
|
||||
|
||||
public static List<String> stop() {
|
||||
return sqlLogger.stop();
|
||||
}
|
||||
|
||||
public static List<String> collect() {
|
||||
return sqlLogger.collect();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user