File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,12 @@ func globalBool(c *cli.Command, name string) bool {
121121// Any log appears in git stdout pipe will break the git protocol, eg: client can't push and hangs forever.
122122func PrepareConsoleLoggerLevel (defaultLevel log.Level ) func (context.Context , * cli.Command ) (context.Context , error ) {
123123 return func (ctx context.Context , c * cli.Command ) (context.Context , error ) {
124+ if setting .InstallLock {
125+ // During config loading, there might also be logs (for example: deprecation warnings).
126+ // It must make sure that console logger is set up before config is loaded.
127+ log .Error ("Config is loaded before console logger is setup, it will cause bugs. Please fix it." )
128+ return nil , errors .New ("console logger must be setup before config is loaded" )
129+ }
124130 level := defaultLevel
125131 if globalBool (c , "quiet" ) {
126132 level = log .FATAL
You can’t perform that action at this time.
0 commit comments