From c143e3d57fe191b39f219b7dd2e8ffdfc706f1ae Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Thu, 6 Sep 2018 02:07:23 +0300 Subject: [PATCH] coredns plugin -- give feedback how many rules were in rulefile --- coredns_plugin/coredns_plugin.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coredns_plugin/coredns_plugin.go b/coredns_plugin/coredns_plugin.go index 6f675fd3..a5b5752a 100644 --- a/coredns_plugin/coredns_plugin.go +++ b/coredns_plugin/coredns_plugin.go @@ -145,6 +145,7 @@ func setupPlugin(c *caddy.Controller) (*Plugin, error) { } defer file.Close() + count := 0 scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() @@ -158,7 +159,9 @@ func setupPlugin(c *caddy.Controller) (*Plugin, error) { if err != nil { return nil, err } + count++ } + log.Printf("Added %d rules from %s", count, filterFileName) if err = scanner.Err(); err != nil { return nil, err