mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Move xorm logger bridge from log to models so that log module could be a standalone package (#6944)
* move xorm logger bridge from log to models so that log module could be a standalone package * fix tests * save logger on xorm log bridge
This commit is contained in:
		@@ -15,7 +15,6 @@ import (
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"code.gitea.io/gitea/modules/log"
 | 
			
		||||
	"code.gitea.io/gitea/modules/setting"
 | 
			
		||||
 | 
			
		||||
	// Needed for the MySQL driver
 | 
			
		||||
@@ -261,7 +260,7 @@ func NewTestEngine(x *xorm.Engine) (err error) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	x.SetMapper(core.GonicMapper{})
 | 
			
		||||
	x.SetLogger(log.XORMLogger)
 | 
			
		||||
	x.SetLogger(NewXORMLogger(!setting.ProdMode))
 | 
			
		||||
	x.ShowSQL(!setting.ProdMode)
 | 
			
		||||
	return x.StoreEngine("InnoDB").Sync2(tables...)
 | 
			
		||||
}
 | 
			
		||||
@@ -276,7 +275,7 @@ func SetEngine() (err error) {
 | 
			
		||||
	x.SetMapper(core.GonicMapper{})
 | 
			
		||||
	// WARNING: for serv command, MUST remove the output to os.stdout,
 | 
			
		||||
	// so use log file to instead print to stdout.
 | 
			
		||||
	x.SetLogger(log.XORMLogger)
 | 
			
		||||
	x.SetLogger(NewXORMLogger(setting.LogSQL))
 | 
			
		||||
	x.ShowSQL(setting.LogSQL)
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user