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/reload.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/reload.go')
-rw-r--r-- | plugin/file/reload.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugin/file/reload.go b/plugin/file/reload.go index 5effae8eb..28e85b5eb 100644 --- a/plugin/file/reload.go +++ b/plugin/file/reload.go @@ -1,9 +1,10 @@ package file import ( - "log" "os" "time" + + "github.com/coredns/coredns/plugin/pkg/log" ) // TickTime is the default time we use to reload zone. Exported to be tweaked in tests. @@ -25,7 +26,7 @@ func (z *Zone) Reload() error { case <-tick.C: reader, err := os.Open(z.file) if err != nil { - log.Printf("[ERROR] Failed to open zone %q in %q: %v", z.origin, z.file, err) + log.Errorf("Failed to open zone %q in %q: %v", z.origin, z.file, err) continue } @@ -33,7 +34,7 @@ func (z *Zone) Reload() error { zone, err := Parse(reader, z.origin, z.file, serial) if err != nil { if _, ok := err.(*serialErr); !ok { - log.Printf("[ERROR] Parsing zone %q: %v", z.origin, err) + log.Errorf("Parsing zone %q: %v", z.origin, err) } continue } @@ -44,7 +45,7 @@ func (z *Zone) Reload() error { z.Tree = zone.Tree z.reloadMu.Unlock() - log.Printf("[INFO] Successfully reloaded zone %q in %q with serial %d", z.origin, z.file, z.Apex.SOA.Serial) + log.Infof("Successfully reloaded zone %q in %q with serial %d", z.origin, z.file, z.Apex.SOA.Serial) z.Notify() case <-z.reloadShutdown: |