(entry *log.Entry)
| 996 | } |
| 997 | |
| 998 | func (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 | |
| 1017 | const SetRequestCookieIsNotSupported = `function request(ctx, params); ctx.request.cookie["test"] = "test"; end` |
| 1018 |
no test coverage detected