diff options
author | 2018-04-19 07:41:56 +0100 | |
---|---|---|
committer | 2018-04-19 07:41:56 +0100 | |
commit | 26d1432ae6c19c91fb6358e7629a9179a85b70f7 (patch) | |
tree | 8a9f94cf11dcebf1f079ab478d4ded4bf710c99f /plugin/reload/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/reload/reload.go')
-rw-r--r-- | plugin/reload/reload.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugin/reload/reload.go b/plugin/reload/reload.go index e7031455f..c1803c89d 100644 --- a/plugin/reload/reload.go +++ b/plugin/reload/reload.go @@ -2,9 +2,10 @@ package reload import ( "crypto/md5" - "log" "time" + "github.com/coredns/coredns/plugin/pkg/log" + "github.com/mholt/caddy" ) @@ -36,7 +37,7 @@ func hook(event caddy.EventName, info interface{}) error { // this should be an instance. ok to panic if not instance := info.(*caddy.Instance) md5sum := md5.Sum(instance.Caddyfile().Body()) - log.Printf("[INFO] Running configuration MD5 = %x\n", md5sum) + log.Infof("Running configuration MD5 = %x\n", md5sum) go func() { tick := time.NewTicker(r.interval) @@ -57,7 +58,7 @@ func hook(event caddy.EventName, info interface{}) error { r.usage = maybeUsed _, err := instance.Restart(corefile) if err != nil { - log.Printf("[ERROR] Corefile changed but reload failed: %s\n", err) + log.Errorf("Corefile changed but reload failed: %s\n", err) continue } // we are done, if the plugin was not set used, then it is not. |