diff --git a/go.mod b/go.mod index 78e384d..22598ac 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/fuyibing/db/v5 go 1.13 require ( - github.com/fuyibing/log/v5 v5.1.7 + github.com/fuyibing/log/v5 v5.1.12 github.com/go-sql-driver/mysql v1.6.0 gopkg.in/yaml.v3 v3.0.1 xorm.io/xorm v1.3.2 diff --git a/logger.go b/logger.go index 839be7b..497218c 100644 --- a/logger.go +++ b/logger.go @@ -49,10 +49,10 @@ func (o *logger) AfterSQL(c xo.LogContext) { if c.Err != nil { if exists { // 链路模式. - spa.Logger().Error("%v", c.Err) + spa.Logger().Error("[SQL] %v", c.Err) } else { // 普通模式. - log.Error("%v", c.Err) + log.Error("[SQL] %v", c.Err) } } }