mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
Update all plugins to use plugin/pkg/log (#1694)
* Update all plugins to use plugin/pkg/log I wish this could have been done with sed. Alas manually changed all callers to use the new plugin/pkg/log package. * Error -> Info * Add docs to debug plugin as well
This commit is contained in:
@@ -4,9 +4,9 @@ package file
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
|
||||
"github.com/coredns/coredns/plugin"
|
||||
"github.com/coredns/coredns/plugin/pkg/log"
|
||||
"github.com/coredns/coredns/request"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
@@ -52,24 +52,24 @@ func (f File) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i
|
||||
state.SizeAndDo(m)
|
||||
w.WriteMsg(m)
|
||||
|
||||
log.Printf("[INFO] Notify from %s for %s: checking transfer", state.IP(), zone)
|
||||
log.Infof("Notify from %s for %s: checking transfer", state.IP(), zone)
|
||||
ok, err := z.shouldTransfer()
|
||||
if ok {
|
||||
z.TransferIn()
|
||||
} else {
|
||||
log.Printf("[INFO] Notify from %s for %s: no serial increase seen", state.IP(), zone)
|
||||
log.Infof("Notify from %s for %s: no serial increase seen", state.IP(), zone)
|
||||
}
|
||||
if err != nil {
|
||||
log.Printf("[WARNING] Notify from %s for %s: failed primary check: %s", state.IP(), zone, err)
|
||||
log.Warningf("Notify from %s for %s: failed primary check: %s", state.IP(), zone, err)
|
||||
}
|
||||
return dns.RcodeSuccess, nil
|
||||
}
|
||||
log.Printf("[INFO] Dropping notify from %s for %s", state.IP(), zone)
|
||||
log.Infof("Dropping notify from %s for %s", state.IP(), zone)
|
||||
return dns.RcodeSuccess, nil
|
||||
}
|
||||
|
||||
if z.Expired != nil && *z.Expired {
|
||||
log.Printf("[ERROR] Zone %s is expired", zone)
|
||||
log.Errorf("Zone %s is expired", zone)
|
||||
return dns.RcodeServerFailure, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user