diff options
author | 2018-04-19 07:41:56 +0100 | |
---|---|---|
committer | 2018-04-19 07:41:56 +0100 | |
commit | 26d1432ae6c19c91fb6358e7629a9179a85b70f7 (patch) | |
tree | 8a9f94cf11dcebf1f079ab478d4ded4bf710c99f /plugin/file/secondary.go | |
parent | 2095eb7979f53618180f759d0e68e4070554870d (diff) | |
download | coredns-26d1432ae6c19c91fb6358e7629a9179a85b70f7.tar.gz coredns-26d1432ae6c19c91fb6358e7629a9179a85b70f7.tar.zst coredns-26d1432ae6c19c91fb6358e7629a9179a85b70f7.zip |
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
Diffstat (limited to 'plugin/file/secondary.go')
-rw-r--r-- | plugin/file/secondary.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/plugin/file/secondary.go b/plugin/file/secondary.go index 0d8f70069..5874b62fc 100644 --- a/plugin/file/secondary.go +++ b/plugin/file/secondary.go @@ -1,10 +1,11 @@ package file import ( - "log" "math/rand" "time" + "github.com/coredns/coredns/plugin/pkg/log" + "github.com/miekg/dns" ) @@ -27,19 +28,19 @@ Transfer: t := new(dns.Transfer) c, err := t.In(m, tr) if err != nil { - log.Printf("[ERROR] Failed to setup transfer `%s' with `%q': %v", z.origin, tr, err) + log.Errorf("Failed to setup transfer `%s' with `%q': %v", z.origin, tr, err) Err = err continue Transfer } for env := range c { if env.Error != nil { - log.Printf("[ERROR] Failed to transfer `%s' from %q: %v", z.origin, tr, env.Error) + log.Errorf("Failed to transfer `%s' from %q: %v", z.origin, tr, env.Error) Err = env.Error continue Transfer } for _, rr := range env.RR { if err := z1.Insert(rr); err != nil { - log.Printf("[ERROR] Failed to parse transfer `%s' from: %q: %v", z.origin, tr, err) + log.Errorf("Failed to parse transfer `%s' from: %q: %v", z.origin, tr, err) Err = err continue Transfer } @@ -55,7 +56,7 @@ Transfer: z.Tree = z1.Tree z.Apex = z1.Apex *z.Expired = false - log.Printf("[INFO] Transferred: %s from %s", z.origin, tr) + log.Infof("Transferred: %s from %s", z.origin, tr) return nil } @@ -139,7 +140,7 @@ Restart: ok, err := z.shouldTransfer() if err != nil { - log.Printf("[WARNING] Failed retry check %s", err) + log.Warningf("Failed retry check %s", err) continue } @@ -162,7 +163,7 @@ Restart: ok, err := z.shouldTransfer() if err != nil { - log.Printf("[WARNING] Failed refresh check %s", err) + log.Warningf("Failed refresh check %s", err) retryActive = true continue } |