Only enable debug logging if debug flag is set
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				ci/woodpecker/push/woodpecker Pipeline was successful
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	ci/woodpecker/push/woodpecker Pipeline was successful
				
			This commit is contained in:
		
							
								
								
									
										6
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								main.go
									
									
									
									
									
								
							@@ -41,7 +41,6 @@ import (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	log.Logger = logger.NewPretty(os.Stderr)
 | 
						log.Logger = logger.NewPretty(os.Stderr)
 | 
				
			||||||
	log.Logger.SetLevel(logger.LogLevelDebug)
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func main() {
 | 
					func main() {
 | 
				
			||||||
@@ -51,8 +50,13 @@ func main() {
 | 
				
			|||||||
	serverAddr := pflag.StringP("address", "a", ":8080", "Webhook server address")
 | 
						serverAddr := pflag.StringP("address", "a", ":8080", "Webhook server address")
 | 
				
			||||||
	genHash := pflag.BoolP("gen-hash", "g", false, "Generate a password hash for webhooks")
 | 
						genHash := pflag.BoolP("gen-hash", "g", false, "Generate a password hash for webhooks")
 | 
				
			||||||
	useEnv := pflag.BoolP("use-env", "E", false, "Use environment variables for configuration")
 | 
						useEnv := pflag.BoolP("use-env", "E", false, "Use environment variables for configuration")
 | 
				
			||||||
 | 
						debug := pflag.BoolP("debug", "d", false, "Enable debug logging")
 | 
				
			||||||
	pflag.Parse()
 | 
						pflag.Parse()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if *debug {
 | 
				
			||||||
 | 
							log.Logger.SetLevel(logger.LogLevelDebug)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if *genHash {
 | 
						if *genHash {
 | 
				
			||||||
		fmt.Print("Password: ")
 | 
							fmt.Print("Password: ")
 | 
				
			||||||
		pwd, err := term.ReadPassword(int(os.Stdin.Fd()))
 | 
							pwd, err := term.ReadPassword(int(os.Stdin.Fd()))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user