mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 00:20:25 +08:00 
			
		
		
		
	Fix trace log to show value instead of pointers (#18926)
- Fixes a issue with a trace of repo.Units whereby it would show the pointers. Before:  After: 
This commit is contained in:
		@@ -290,7 +290,14 @@ func (repo *Repository) LoadUnits(ctx context.Context) (err error) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	repo.Units, err = getUnitsByRepoID(db.GetEngine(ctx), repo.ID)
 | 
			
		||||
	log.Trace("repo.Units: %-+v", repo.Units)
 | 
			
		||||
	if log.IsTrace() {
 | 
			
		||||
		unitTypeStrings := make([]string, len(repo.Units))
 | 
			
		||||
		for i, unit := range repo.Units {
 | 
			
		||||
			unitTypeStrings[i] = unit.Type.String()
 | 
			
		||||
		}
 | 
			
		||||
		log.Trace("repo.Units, ID=%d, Types: [%s]", repo.ID, strings.Join(unitTypeStrings, ", "))
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user