This commit is contained in:
jiangyong27 2024-03-07 18:03:06 +08:00
parent 0c181e1796
commit 1a2edd7997
1 changed files with 3 additions and 1 deletions

View File

@ -38,7 +38,9 @@ func (d *GORMLogger) Trace(ctx context.Context, begin time.Time, fc func() (sql
if d.Threshold > 0 && time.Since(begin).Milliseconds() > d.Threshold {
log.Errorf("[SQL]sql=%s affect=%d cost=%dms", sql, affects, time.Since(begin).Milliseconds())
} else {
log.Debugf("[SQL]sql=%s affect=%d cost=%dms", sql, affects, time.Since(begin).Milliseconds())
if len(sql) <= 1000 {
log.Debugf("[SQL]sql=%s affect=%d cost=%dms", sql, affects, time.Since(begin).Milliseconds())
}
}
}
}