coredns plugin -- give feedback how many rules were in rulefile

This commit is contained in:
Eugene Bujak 2018-09-06 02:07:23 +03:00
parent 1102963fa0
commit c143e3d57f
1 changed files with 3 additions and 0 deletions

View File

@ -145,6 +145,7 @@ func setupPlugin(c *caddy.Controller) (*Plugin, error) {
} }
defer file.Close() defer file.Close()
count := 0
scanner := bufio.NewScanner(file) scanner := bufio.NewScanner(file)
for scanner.Scan() { for scanner.Scan() {
text := scanner.Text() text := scanner.Text()
@ -158,7 +159,9 @@ func setupPlugin(c *caddy.Controller) (*Plugin, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
count++
} }
log.Printf("Added %d rules from %s", count, filterFileName)
if err = scanner.Err(); err != nil { if err = scanner.Err(); err != nil {
return nil, err return nil, err