| 
									
										
										
										
											2017-06-13 15:47:17 -07:00
										 |  |  | package debug | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import ( | 
					
						
							| 
									
										
										
										
											2020-09-24 18:14:41 +02:00
										 |  |  | 	"github.com/coredns/caddy" | 
					
						
							| 
									
										
										
										
											2017-06-13 15:47:17 -07:00
										 |  |  | 	"github.com/coredns/coredns/core/dnsserver" | 
					
						
							| 
									
										
										
										
											2017-09-14 09:36:06 +01:00
										 |  |  | 	"github.com/coredns/coredns/plugin" | 
					
						
							| 
									
										
										
										
											2017-06-13 15:47:17 -07:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-28 10:40:43 +01:00
										 |  |  | func init() { plugin.Register("debug", setup) } | 
					
						
							| 
									
										
										
										
											2017-06-13 15:47:17 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | func setup(c *caddy.Controller) error { | 
					
						
							|  |  |  | 	config := dnsserver.GetConfig(c) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	for c.Next() { | 
					
						
							|  |  |  | 		if c.NextArg() { | 
					
						
							| 
									
										
										
										
											2017-09-14 09:36:06 +01:00
										 |  |  | 			return plugin.Error("debug", c.ArgErr()) | 
					
						
							| 
									
										
										
										
											2017-06-13 15:47:17 -07:00
										 |  |  | 		} | 
					
						
							|  |  |  | 		config.Debug = true | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return nil | 
					
						
							|  |  |  | } |