mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
StaticLog rename to LogUtil
This commit is contained in:
@@ -17,7 +17,7 @@ import org.dromara.hutool.db.dialect.Dialect;
|
||||
import org.dromara.hutool.db.dialect.DialectFactory;
|
||||
import org.dromara.hutool.db.ds.DSUtil;
|
||||
import org.dromara.hutool.db.transaction.TransactionLevel;
|
||||
import org.dromara.hutool.log.StaticLog;
|
||||
import org.dromara.hutool.log.LogUtil;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
@@ -190,7 +190,7 @@ public class Db extends AbstractDb<Db> {
|
||||
try {
|
||||
conn.rollback();
|
||||
} catch (final Exception e) {
|
||||
StaticLog.error(e);
|
||||
LogUtil.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ public class Db extends AbstractDb<Db> {
|
||||
try {
|
||||
conn.setAutoCommit(autoCommit);
|
||||
} catch (final Exception e) {
|
||||
StaticLog.error(e);
|
||||
LogUtil.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ import org.dromara.hutool.db.dialect.impl.PhoenixDialect;
|
||||
import org.dromara.hutool.db.dialect.impl.PostgresqlDialect;
|
||||
import org.dromara.hutool.db.dialect.impl.SqlServer2012Dialect;
|
||||
import org.dromara.hutool.db.dialect.impl.Sqlite3Dialect;
|
||||
import org.dromara.hutool.log.StaticLog;
|
||||
import org.dromara.hutool.log.LogUtil;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
@@ -51,7 +51,7 @@ public class DialectFactory implements DriverNamePool {
|
||||
*/
|
||||
public static Dialect newDialect(final String driverName) {
|
||||
final Dialect dialect = internalNewDialect(driverName);
|
||||
StaticLog.debug("Use Dialect: [{}].", dialect.getClass().getSimpleName());
|
||||
LogUtil.debug("Use Dialect: [{}].", dialect.getClass().getSimpleName());
|
||||
return dialect;
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@ import org.dromara.hutool.core.reflect.ConstructorUtil;
|
||||
import org.dromara.hutool.core.spi.ListServiceLoader;
|
||||
import org.dromara.hutool.db.DbRuntimeException;
|
||||
import org.dromara.hutool.db.GlobalDbConfig;
|
||||
import org.dromara.hutool.log.StaticLog;
|
||||
import org.dromara.hutool.log.LogUtil;
|
||||
import org.dromara.hutool.setting.Setting;
|
||||
|
||||
import javax.naming.InitialContext;
|
||||
@@ -42,7 +42,7 @@ public class DSUtil {
|
||||
try {
|
||||
return getJndiDS(jndiName);
|
||||
} catch (final DbRuntimeException e) {
|
||||
StaticLog.error(e.getCause(), "Find JNDI datasource error!");
|
||||
LogUtil.error(e.getCause(), "Find JNDI datasource error!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public class DSUtil {
|
||||
*/
|
||||
public static DSFactory createFactory(final Setting setting) {
|
||||
final DSFactory dsFactory = _createFactory(setting);
|
||||
StaticLog.debug("Use [{}] DataSource As Default.", dsFactory.getDataSourceName());
|
||||
LogUtil.debug("Use [{}] DataSource As Default.", dsFactory.getDataSourceName());
|
||||
return dsFactory;
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@ package org.dromara.hutool.db.ds;
|
||||
|
||||
import org.dromara.hutool.core.io.IoUtil;
|
||||
import org.dromara.hutool.core.util.RuntimeUtil;
|
||||
import org.dromara.hutool.log.StaticLog;
|
||||
import org.dromara.hutool.log.LogUtil;
|
||||
|
||||
/**
|
||||
* 全局单例数据源工厂<br>
|
||||
@@ -36,7 +36,7 @@ public class GlobalDSFactory {
|
||||
RuntimeUtil.addShutdownHook(()->{
|
||||
if (null != factory) {
|
||||
IoUtil.closeQuietly(factory);
|
||||
StaticLog.debug("DataSource: [{}] closed.", factory.getDataSourceName());
|
||||
LogUtil.debug("DataSource: [{}] closed.", factory.getDataSourceName());
|
||||
factory = null;
|
||||
}
|
||||
});
|
||||
@@ -83,7 +83,7 @@ public class GlobalDSFactory {
|
||||
IoUtil.closeQuietly(factory);
|
||||
}
|
||||
|
||||
StaticLog.debug("Custom use [{}] DataSource.", customDSFactory.getDataSourceName());
|
||||
LogUtil.debug("Custom use [{}] DataSource.", customDSFactory.getDataSourceName());
|
||||
factory = customDSFactory;
|
||||
}
|
||||
return factory;
|
||||
|
@@ -2,7 +2,7 @@ package org.dromara.hutool.db;
|
||||
|
||||
import org.dromara.hutool.db.handler.EntityListHandler;
|
||||
import org.dromara.hutool.db.sql.Condition;
|
||||
import org.dromara.hutool.log.StaticLog;
|
||||
import org.dromara.hutool.log.LogUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -119,7 +119,7 @@ public class DbTest {
|
||||
Condition.parse("age", "< 100")
|
||||
);
|
||||
for (final Entity entity : find) {
|
||||
StaticLog.debug("{}", entity);
|
||||
LogUtil.debug("{}", entity);
|
||||
}
|
||||
Assertions.assertEquals("unitTestUser", find.get(0).get("name"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user