MCPcopy Index your code
hub / github.com/coder/coder / parseLogLines

Function parseLogLines

coderd/aibridgedserver/aibridgedserver_test.go:1439–1449  ·  view source on GitHub ↗

parseLogLines parses JSON log lines from a buffer.

(buf *bytes.Buffer)

Source from the content-addressed store, hash-verified

1437
1438// parseLogLines parses JSON log lines from a buffer.
1439func parseLogLines(buf *bytes.Buffer) []logLine {
1440 var lines []logLine
1441 scanner := bufio.NewScanner(buf)
1442 for scanner.Scan() {
1443 var line logLine
1444 if err := json.Unmarshal(scanner.Bytes(), &line); err == nil {
1445 lines = append(lines, line)
1446 }
1447 }
1448 return lines
1449}
1450
1451// getLogLinesWithMessage returns all log lines with the given message.
1452func getLogLinesWithMessage(lines []logLine, msg string) []logLine {

Callers 1

TestStructuredLoggingFunction · 0.85

Calls 3

ScanMethod · 0.45
UnmarshalMethod · 0.45
BytesMethod · 0.45

Tested by

no test coverage detected