public enum SqlLog extends Enum<SqlLog>
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Field and Description |
---|---|
static String |
KEY_FORMAT_SQL
配置文件中配置属性名:是否格式化SQL
|
static String |
KEY_SHOW_PARAMS
配置文件中配置属性名:是否显示参数
|
static String |
KEY_SHOW_SQL
配置文件中配置属性名:是否显示SQL
|
static String |
KEY_SQL_LEVEL
配置文件中配置属性名:显示的日志级别
|
Modifier and Type | Method and Description |
---|---|
void |
init(boolean isShowSql,
boolean isFormatSql,
boolean isShowParams,
Level level)
设置全局配置:是否通过debug日志显示SQL
|
void |
log(String sql)
打印SQL日志
|
void |
log(String sql,
Object paramValues)
打印SQL日志
|
void |
logForBatch(String sql)
打印批量 SQL日志
|
static SqlLog |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SqlLog[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SqlLog INSTANCE
public static final String KEY_SHOW_SQL
public static final String KEY_FORMAT_SQL
public static final String KEY_SHOW_PARAMS
public static final String KEY_SQL_LEVEL
public static SqlLog[] values()
for (SqlLog c : SqlLog.values()) System.out.println(c);
public static SqlLog valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic void init(boolean isShowSql, boolean isFormatSql, boolean isShowParams, Level level)
isShowSql
- 是否显示SQLisFormatSql
- 是否格式化显示的SQLisShowParams
- 是否打印参数level
- 日志级别public void log(String sql)
sql
- SQL语句public void logForBatch(String sql)
sql
- SQL语句Copyright © 2024. All rights reserved.