mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user