aboutsummaryrefslogtreecommitdiff
path: root/plugin/pkg/log/plugin_test.go
blob: b24caa48b09275056d6f2c1d99faacd27c51dec5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package log

import (
	"bytes"
	golog "log"
	"strings"
	"testing"
)

func TestPlugins(t *testing.T) {
	var f bytes.Buffer
	const ts = "test"
	golog.SetOutput(&f)

	lg := NewWithPlugin("testplugin")

	lg.Info(ts)
	if x := f.String(); !strings.Contains(x, "plugin/testplugin") {
		t.Errorf("Expected log to be %s, got %s", info+ts, x)
	}
}