mirror of
				https://github.com/kubernetes-sigs/external-dns.git
				synced 2025-10-31 02:31:00 +01:00 
			
		
		
		
	Don't discard klog logs at the highest log levels (debug and trace)
This commit is contained in:
		
							parent
							
								
									2a45cc85a4
								
							
						
					
					
						commit
						c25a229e5f
					
				
							
								
								
									
										10
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								main.go
									
									
									
									
									
								
							| @ -100,10 +100,12 @@ func main() { | ||||
| 	} | ||||
| 	log.SetLevel(ll) | ||||
| 
 | ||||
| 	// Klog V2 is used by k8s.io/apimachinery/pkg/labels and can throw (a lot) of irrelevant logs | ||||
| 	// See https://github.com/kubernetes-sigs/external-dns/issues/2348 | ||||
| 	defer klog.ClearLogger() | ||||
| 	klog.SetLogger(logr.Discard()) | ||||
| 	if ll >= log.DebugLevel { | ||||
| 		// Klog V2 is used by k8s.io/apimachinery/pkg/labels and can throw (a lot) of irrelevant logs | ||||
| 		// See https://github.com/kubernetes-sigs/external-dns/issues/2348 | ||||
| 		defer klog.ClearLogger() | ||||
| 		klog.SetLogger(logr.Discard()) | ||||
| 	} | ||||
| 
 | ||||
| 	ctx, cancel := context.WithCancel(context.Background()) | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user