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

Method Format

script/script_test.go:998–1015  ·  view source on GitHub ↗
(entry *log.Entry)

Source from the content-addressed store, hash-verified

996}
997
998func (f *exampleLogFormatter) Format(entry *log.Entry) ([]byte, error) {
999 var b *bytes.Buffer
1000 if entry.Buffer != nil {
1001 b = entry.Buffer
1002 } else {
1003 b = &bytes.Buffer{}
1004 }
1005
1006 for line := range strings.SplitSeq(entry.Message, "\n") {
1007 // escape \r to use testable examples
1008 line = strings.ReplaceAll(line, "\r", `\r`)
1009 line = strings.TrimRight(line, " ")
1010
1011 b.WriteString(line)
1012 b.WriteString("\n")
1013 }
1014 return b.Bytes(), nil
1015}
1016
1017const SetRequestCookieIsNotSupported = `function request(ctx, params); ctx.request.cookie["test"] = "test"; end`
1018

Callers 1

TestSecretPathsFunction · 0.45

Calls 2

BytesMethod · 0.80
WriteStringMethod · 0.65

Tested by

no test coverage detected