parent
8f7f3ad315
commit
3f359eab9b
@ -139,7 +139,11 @@ func (l logger) Error(ctx context.Context, msg string, data ...interface{}) {
|
||||
|
||||
// Trace print sql message
|
||||
func (l logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error) {
|
||||
if l.LogLevel > Silent {
|
||||
|
||||
if l.LogLevel <= Silent {
|
||||
return
|
||||
}
|
||||
|
||||
elapsed := time.Since(begin)
|
||||
switch {
|
||||
case err != nil && l.LogLevel >= Error && (!errors.Is(err, ErrRecordNotFound) || !l.IgnoreRecordNotFoundError):
|
||||
@ -166,7 +170,6 @@ func (l logger) Trace(ctx context.Context, begin time.Time, fc func() (string, i
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type traceRecorder struct {
|
||||
Interface
|
||||
|
Loading…
x
Reference in New Issue
Block a user