(t *testing.T)
| 26 | } |
| 27 | |
| 28 | func TestNoExtraFormatDirectives(t *testing.T) { |
| 29 | buf := new(bytes.Buffer) |
| 30 | SetOutput(buf) |
| 31 | SetPrefix("foo", "bar") |
| 32 | Printkv(context.Background(), "baz", 1) |
| 33 | SetOutput(os.Stdout) |
| 34 | got := buf.String() |
| 35 | if strings.Contains(got, "%") { |
| 36 | t.Errorf("log line appears to contain format directive: %q", got) |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | func TestPrefix(t *testing.T) { |
| 41 | buf := new(bytes.Buffer) |