From 0e065a2e61e898f574d48696ce5b622e3132e5e9 Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Tue, 30 Oct 2018 12:57:16 +0300 Subject: [PATCH] Added more logging to the plugin --- coredns_plugin/coredns_plugin.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/coredns_plugin/coredns_plugin.go b/coredns_plugin/coredns_plugin.go index 58c19604..ff04908d 100644 --- a/coredns_plugin/coredns_plugin.go +++ b/coredns_plugin/coredns_plugin.go @@ -97,6 +97,7 @@ func setupPlugin(c *caddy.Controller) (*plug, error) { blockValue := c.Val() switch blockValue { case "safebrowsing": + log.Println("Browsing security service is enabled") p.d.EnableSafeBrowsing() if c.NextArg() { if len(c.Val()) == 0 { @@ -105,6 +106,7 @@ func setupPlugin(c *caddy.Controller) (*plug, error) { p.d.SetSafeBrowsingServer(c.Val()) } case "safesearch": + log.Println("Safe search is enabled") p.d.EnableSafeSearch() case "parental": if !c.NextArg() { @@ -114,6 +116,8 @@ func setupPlugin(c *caddy.Controller) (*plug, error) { if err != nil { return nil, c.ArgErr() } + + log.Println("Parental control is enabled") err = p.d.EnableParental(sensitivity) if err != nil { return nil, c.ArgErr() @@ -128,14 +132,15 @@ func setupPlugin(c *caddy.Controller) (*plug, error) { if !c.NextArg() { return nil, c.ArgErr() } - blockttl, err := strconv.ParseUint(c.Val(), 10, 32) + blockedTtl, err := strconv.ParseUint(c.Val(), 10, 32) if err != nil { return nil, c.ArgErr() } - p.settings.BlockedTTL = uint32(blockttl) + log.Printf("Blocked request TTL is %d", blockedTtl) + p.settings.BlockedTTL = uint32(blockedTtl) case "querylog": + log.Println("Query log is enabled") p.settings.QueryLogEnabled = true - case "filter": if !c.NextArg() { return nil, c.ArgErr()