aboutsummaryrefslogtreecommitdiff
path: root/plugin/log/log_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/log/log_test.go')
-rw-r--r--plugin/log/log_test.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/plugin/log/log_test.go b/plugin/log/log_test.go
index d1ff8d36d..6d74f23ad 100644
--- a/plugin/log/log_test.go
+++ b/plugin/log/log_test.go
@@ -18,14 +18,15 @@ import (
func init() { clog.Discard() }
func TestLoggedStatus(t *testing.T) {
- var f bytes.Buffer
rule := Rule{
NameScope: ".",
Format: DefaultLogFormat,
- Log: log.New(&f, "", 0),
Class: map[response.Class]bool{response.All: true},
}
+ var f bytes.Buffer
+ log.SetOutput(&f)
+
logger := Logger{
Rules: []Rule{rule},
Next: test.ErrorHandler(),
@@ -49,14 +50,15 @@ func TestLoggedStatus(t *testing.T) {
}
func TestLoggedClassDenial(t *testing.T) {
- var f bytes.Buffer
rule := Rule{
NameScope: ".",
Format: DefaultLogFormat,
- Log: log.New(&f, "", 0),
Class: map[response.Class]bool{response.Denial: true},
}
+ var f bytes.Buffer
+ log.SetOutput(&f)
+
logger := Logger{
Rules: []Rule{rule},
Next: test.ErrorHandler(),
@@ -77,14 +79,15 @@ func TestLoggedClassDenial(t *testing.T) {
}
func TestLoggedClassError(t *testing.T) {
- var f bytes.Buffer
rule := Rule{
NameScope: ".",
Format: DefaultLogFormat,
- Log: log.New(&f, "", 0),
Class: map[response.Class]bool{response.Error: true},
}
+ var f bytes.Buffer
+ log.SetOutput(&f)
+
logger := Logger{
Rules: []Rule{rule},
Next: test.ErrorHandler(),