From 8d13770b0d4b6d8fde0a61bbfdaa7bf9817142f6 Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Thu, 11 Oct 2018 18:33:07 +0300 Subject: [PATCH] Remove unneeded debug prints --- coredns_plugin/coredns_plugin.go | 9 +++++---- coredns_plugin/querylog_file.go | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/coredns_plugin/coredns_plugin.go b/coredns_plugin/coredns_plugin.go index 4b00eca6..cb372a22 100644 --- a/coredns_plugin/coredns_plugin.go +++ b/coredns_plugin/coredns_plugin.go @@ -242,9 +242,10 @@ func (p *plug) parseEtcHosts(text string) bool { return false } for _, host := range fields[1:] { - if val, ok := p.hosts[host]; ok { - log.Printf("warning: host %s already has value %s, will overwrite it with %s", host, val, addr) - } + // debug logging for duplicate values, pretty common if you subscribe to many hosts files + // if val, ok := p.hosts[host]; ok { + // log.Printf("warning: host %s already has value %s, will overwrite it with %s", host, val, addr) + // } p.hosts[host] = addr } return true @@ -323,7 +324,7 @@ func (p *plug) replaceHostWithValAndReply(ctx context.Context, w dns.ResponseWri // check if it's a domain name or IP address addr := net.ParseIP(val) var records []dns.RR - log.Println("Will give", val, "instead of", host) + // log.Println("Will give", val, "instead of", host) // debug logging if addr != nil { // this is an IP address, return it result, err := dns.NewRR(fmt.Sprintf("%s %d A %s", host, p.settings.BlockedTTL, val)) diff --git a/coredns_plugin/querylog_file.go b/coredns_plugin/querylog_file.go index f5f6d09b..b9078ef2 100644 --- a/coredns_plugin/querylog_file.go +++ b/coredns_plugin/querylog_file.go @@ -221,7 +221,7 @@ func genericLoader(onEntry func(entry *logEntry) error, needMore func() bool, ti } if now.Sub(entry.Time) > timeWindow { - trace("skipping entry") + // trace("skipping entry") // debug logging continue }