aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugin/log/log.go2
-rw-r--r--plugin/log/log_test.go13
2 files changed, 14 insertions, 1 deletions
diff --git a/plugin/log/log.go b/plugin/log/log.go
index 7e6201138..78ed53407 100644
--- a/plugin/log/log.go
+++ b/plugin/log/log.go
@@ -46,7 +46,7 @@ func (l Logger) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
}
if ok || ok1 {
logstr := l.repl.Replace(ctx, state, rrw, rule.Format)
- clog.Infof(logstr)
+ clog.Info(logstr)
}
return rc, err
diff --git a/plugin/log/log_test.go b/plugin/log/log_test.go
index 1914e05f3..e2f3acfdb 100644
--- a/plugin/log/log_test.go
+++ b/plugin/log/log_test.go
@@ -202,6 +202,19 @@ func TestLogged(t *testing.T) {
ShouldLog: true,
ShouldString: "\"0\"",
},
+ {
+ Rules: []Rule{
+ {
+ NameScope: ".",
+ Format: CombinedLogFormat,
+ Class: map[response.Class]struct{}{response.All: {}},
+ },
+ },
+ Domain: "foo.%s.example.org.",
+ ShouldLog: true,
+ ShouldString: "foo.%s.example.org.",
+ ShouldNOTString: "%!s(MISSING)",
+ },
}
for _, tc := range tests {