mirror of
				https://github.com/onyx-and-iris/q3rcon-proxy.git
				synced 2025-11-04 06:41:48 +00:00 
			
		
		
		
	set loglevel in Before function
This commit is contained in:
		
							parent
							
								
									28baa2ed00
								
							
						
					
					
						commit
						5e399b8590
					
				@ -55,6 +55,14 @@ func main() {
 | 
			
		||||
				Sources: cli.EnvVars("Q3RCON_LOGLEVEL"),
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		Before: func(ctx context.Context, cmd *cli.Command) (context.Context, error) {
 | 
			
		||||
			logLevel, err := log.ParseLevel(cmd.String("loglevel"))
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return ctx, fmt.Errorf("invalid log level: %w", err)
 | 
			
		||||
			}
 | 
			
		||||
			log.SetLevel(logLevel)
 | 
			
		||||
			return ctx, nil
 | 
			
		||||
		},
 | 
			
		||||
		Action: func(_ context.Context, cmd *cli.Command) error {
 | 
			
		||||
			errChan := make(chan error)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user