update logger

This commit is contained in:
白茶清欢 2024-06-30 19:39:44 +08:00
parent b0953d706e
commit 91c174b80f

View File

@ -245,7 +245,7 @@ func (c *client) GetDatabaseClient(conf *Driver, logInstance *zap.Logger) (*gorm
return nil, fmt.Errorf("%v : db driver is not support", conf.DBType)
}
instance.Logger = wrapper.NewGormLoggerWithInstance(instance, logInstance, "", nil)
instance.Logger = wrapper.NewGormLoggerWithInstance(nil, instance, logInstance, "", nil)
return instance, nil
}
@ -323,5 +323,5 @@ func (dc *DBClient) GetSlave(ctx context.Context) *gorm.DB {
//
// Date : 3:45 PM 2021/12/24
func (dc *DBClient) getLogger(ctx context.Context, dbClient *gorm.DB, node string) gormLogger.Interface {
return wrapper.NewGormLoggerWithInstance(dbClient, dc.loggerInstance, dc.dbFlag+"|"+node, dc.extraFieldList)
return wrapper.NewGormLoggerWithInstance(ctx, dbClient, dc.loggerInstance, dc.dbFlag+"|"+node, dc.extraFieldList)
}