mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
plugin/log: allow various combinations of classes of responses (#1664)
This allows to log responses of different classes, for example, denial and error.
This commit is contained in:
committed by
Miek Gieben
parent
a20b4fe2de
commit
ccfe691b95
@@ -20,6 +20,7 @@ func TestLoggedStatus(t *testing.T) {
|
||||
NameScope: ".",
|
||||
Format: DefaultLogFormat,
|
||||
Log: log.New(&f, "", 0),
|
||||
Class: map[response.Class]bool{response.All: true},
|
||||
}
|
||||
|
||||
logger := Logger{
|
||||
@@ -50,7 +51,7 @@ func TestLoggedClassDenial(t *testing.T) {
|
||||
NameScope: ".",
|
||||
Format: DefaultLogFormat,
|
||||
Log: log.New(&f, "", 0),
|
||||
Class: response.Denial,
|
||||
Class: map[response.Class]bool{response.Denial: true},
|
||||
}
|
||||
|
||||
logger := Logger{
|
||||
@@ -78,7 +79,7 @@ func TestLoggedClassError(t *testing.T) {
|
||||
NameScope: ".",
|
||||
Format: DefaultLogFormat,
|
||||
Log: log.New(&f, "", 0),
|
||||
Class: response.Error,
|
||||
Class: map[response.Class]bool{response.Error: true},
|
||||
}
|
||||
|
||||
logger := Logger{
|
||||
|
||||
Reference in New Issue
Block a user