func (l *GormLogger) Info(ctx context.Context, msg string, data ...interface{}) {
	if l.LogLevel >= logger.Info {
		logrus.WithContext(ctx).Info(msg, append([]interface{}{utils.FileWithLineNum()}, data...))
	}
}
Info print info
package db
import (
	"context"
	"fmt"
	"time"
	"github.com/sirupsen/logrus"
	"gorm.io/gorm/logger"
	"gorm.io/gorm/utils"
)
type GormLogger struct {
	LogLevel      logger.LogLevel
	SlowThreshold time.Duration
}
var (
	LogrusGormLogger = GormLogger{
		LogLevel:      logger.Warn,
		SlowThreshold: 200 * time.Millisecond,
	}
)
func (l *GormLogger) LogMode(level logger.LogLevel) logger.Interface {
	newlogger := *l
	l.LogLevel = level
	return &newlogger
}