mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 01:34:27 +00:00 
			
		
		
		
	disable console output xorm log on ssh (#993)
This commit is contained in:
		@@ -958,7 +958,6 @@ func newLogService() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	for i, mode := range LogModes {
 | 
						for i, mode := range LogModes {
 | 
				
			||||||
		sec, err := Cfg.GetSection("log." + mode)
 | 
							sec, err := Cfg.GetSection("log." + mode)
 | 
				
			||||||
 | 
					 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			sec, _ = Cfg.NewSection("log." + mode)
 | 
								sec, _ = Cfg.NewSection("log." + mode)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@@ -1025,9 +1024,10 @@ func NewXORMLogService(disableConsole bool) {
 | 
				
			|||||||
		if disableConsole && mode == "console" {
 | 
							if disableConsole && mode == "console" {
 | 
				
			||||||
			continue
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		sec, err := Cfg.GetSection("log." + mode)
 | 
							sec, err := Cfg.GetSection("log." + mode)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			log.Fatal(4, "Unknown log mode: %s", mode)
 | 
								sec, _ = Cfg.NewSection("log." + mode)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		validLevels := []string{"Trace", "Debug", "Info", "Warn", "Error", "Critical"}
 | 
							validLevels := []string{"Trace", "Debug", "Info", "Warn", "Error", "Critical"}
 | 
				
			||||||
@@ -1079,7 +1079,9 @@ func NewXORMLogService(disableConsole bool) {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		log.NewXORMLogger(Cfg.Section("log").Key("BUFFER_LEN").MustInt64(10000), mode, logConfigs)
 | 
							log.NewXORMLogger(Cfg.Section("log").Key("BUFFER_LEN").MustInt64(10000), mode, logConfigs)
 | 
				
			||||||
 | 
							if !disableConsole {
 | 
				
			||||||
			log.Info("XORM Log Mode: %s(%s)", strings.Title(mode), levelName)
 | 
								log.Info("XORM Log Mode: %s(%s)", strings.Title(mode), levelName)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		var lvl core.LogLevel
 | 
							var lvl core.LogLevel
 | 
				
			||||||
		switch levelName {
 | 
							switch levelName {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user