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

Function testAccessLogExtended

logging/access_test.go:73–92  ·  view source on GitHub ↗
(t *testing.T, entry *AccessEntry,
	additional map[string]any,
	expectedOutput string,
	o Options,
)

Source from the content-addressed store, hash-verified

71}
72
73func testAccessLogExtended(t *testing.T, entry *AccessEntry,
74 additional map[string]any,
75 expectedOutput string,
76 o Options,
77) {
78 var buf bytes.Buffer
79 o.AccessLogOutput = &buf
80 lg := NewAccessLogger(o)
81 lg.LogAccess(entry, additional)
82 got := buf.String()
83 if got != "" {
84 got = got[:len(got)-1]
85 }
86
87 if got != expectedOutput {
88 t.Error("got wrong access log.")
89 t.Log("got :", got)
90 t.Log("expected:", expectedOutput)
91 }
92}
93
94func testAccessLogDefault(t *testing.T, entry *AccessEntry, expectedOutput string) {
95 testAccessLog(t, entry, expectedOutput, Options{})

Calls 5

LogAccessMethod · 0.95
NewAccessLoggerFunction · 0.85
LogMethod · 0.80
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…