Move to logging package (#191)

* Updating comment to remove references to Caddy

* Updating README to mark TODO items complete

* Changing all debug print statements over to use logging package
This commit is contained in:
Michael Richmond
2016-07-18 10:47:36 -07:00
committed by Miek Gieben
parent 3f4ec783d2
commit 3ba86f2421
9 changed files with 40 additions and 53 deletions

View File

@@ -2,7 +2,7 @@ package nametemplate
import (
"errors"
"fmt"
"log"
"strings"
"github.com/miekg/coredns/middleware/kubernetes/util"
@@ -65,7 +65,6 @@ type NameTemplate struct {
func (t *NameTemplate) SetTemplate(s string) error {
var err error
fmt.Println()
t.Element = map[string]int{}
@@ -83,10 +82,10 @@ func (t *NameTemplate) SetTemplate(s string) error {
if !elementPositionSet {
if strings.Contains(v, "{") {
err = errors.New("Record name template contains the unknown symbol '" + v + "'")
fmt.Printf("[debug] %v\n", err)
log.Printf("[debug] %v\n", err)
return err
} else {
fmt.Printf("[debug] Template string has static element '%v'\n", v)
log.Printf("[debug] Template string has static element '%v'\n", v)
}
}
}