(t *testing.T)
| 23 | } |
| 24 | |
| 25 | func TestCustomPrefixForApplicationLog(t *testing.T) { |
| 26 | var buf bytes.Buffer |
| 27 | prefix := "[TEST_PREFIX]" |
| 28 | _ = NewAccessLogger(Options{ |
| 29 | ApplicationLogOutput: &buf, |
| 30 | ApplicationLogPrefix: prefix}) |
| 31 | log.Infof("Hello, world!") |
| 32 | got := buf.String() |
| 33 | if !strings.HasPrefix(got, "[TEST_PREFIX]") || !strings.Contains(got, "Hello, world!") { |
| 34 | t.Error("failed to use custom prefix") |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | func TestCustomOutputForAccessLog(t *testing.T) { |
| 39 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected
searching dependent graphs…