MCPcopy Create free account
hub / github.com/zalando/skipper / TestCustomPrefixForApplicationLog

Function TestCustomPrefixForApplicationLog

logging/log_test.go:25–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23}
24
25func 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
38func TestCustomOutputForAccessLog(t *testing.T) {
39 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 4

NewAccessLoggerFunction · 0.85
InfofMethod · 0.65
StringMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…