升级数据库日志, 增加sql类型
This commit is contained in:
parent
8ae4053b24
commit
98eb52ae30
@ -180,7 +180,7 @@ func (g *Gorm) write(ctx context.Context, message string, level string, data map
|
||||
sqlStr := strings.TrimSpace(fmt.Sprintf("%v", data["sql"]))
|
||||
sqlArr := strings.Split(sqlStr, " ")
|
||||
if len(sqlArr) > 0 {
|
||||
message = fmt.Sprintf("【%v】" + message)
|
||||
data["sql_type"] = strings.ToUpper(sqlArr[0])
|
||||
}
|
||||
}
|
||||
if nil == g.outCtx {
|
||||
|
Loading…
Reference in New Issue
Block a user