mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 11:28:24 +00:00 
			
		
		
		
	Backport #30240 by wxiaoguang Major changes: * Move some functions like "addReader" / "isSubDir" / "addRecursiveExclude" to a separate package, and add tests * Clarify the filename&dump type logic and add tests * Clarify the logger behavior and remove FIXME comments Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		| @@ -185,8 +185,13 @@ func InitLoggersForTest() { | ||||
| 	initAllLoggers() | ||||
| } | ||||
|  | ||||
| var initLoggerDisabled bool | ||||
|  | ||||
| // initAllLoggers creates all the log services | ||||
| func initAllLoggers() { | ||||
| 	if initLoggerDisabled { | ||||
| 		return | ||||
| 	} | ||||
| 	initManagedLoggers(log.GetManager(), CfgProvider) | ||||
|  | ||||
| 	golog.SetFlags(0) | ||||
| @@ -194,6 +199,10 @@ func initAllLoggers() { | ||||
| 	golog.SetOutput(log.LoggerToWriter(log.GetLogger(log.DEFAULT).Info)) | ||||
| } | ||||
|  | ||||
| func DisableLoggerInit() { | ||||
| 	initLoggerDisabled = true | ||||
| } | ||||
|  | ||||
| func initManagedLoggers(manager *log.LoggerManager, cfg ConfigProvider) { | ||||
| 	loadLogGlobalFrom(cfg) | ||||
| 	prepareLoggerConfig(cfg) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user