Documentation ¶
Index ¶
- func Get(name string) *gorm.DB
- func MainDB() *gorm.DB
- type Instance
- type MySqlLogger
- func (l *MySqlLogger) Error(ctx context.Context, msg string, data ...interface{})
- func (l *MySqlLogger) Info(ctx context.Context, msg string, data ...interface{})
- func (l *MySqlLogger) LogMode(level gormLogger.LogLevel) gormLogger.Interface
- func (l *MySqlLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l *MySqlLogger) Warn(ctx context.Context, msg string, data ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MySqlLogger ¶
type MySqlLogger struct { gormLogger.Config ZLogger zerolog.Logger // contains filtered or unexported fields }
func NewMysqlLogger ¶
func NewMysqlLogger(zlog zerolog.Logger, config gormLogger.Config) *MySqlLogger
============================================================ * * 功能:整合 zerologger 到 mysql 中 * 自定义 日志 风格格式 * ============================================================
func (*MySqlLogger) Error ¶
func (l *MySqlLogger) Error(ctx context.Context, msg string, data ...interface{})
func (*MySqlLogger) Info ¶
func (l *MySqlLogger) Info(ctx context.Context, msg string, data ...interface{})
func (*MySqlLogger) LogMode ¶
func (l *MySqlLogger) LogMode(level gormLogger.LogLevel) gormLogger.Interface
实现 mysql 的日志 信息接口
Click to show internal directories.
Click to hide internal directories.