MCPcopy Create free account
hub / github.com/efficientgo/e2e / Write

Method Write

logger.go:54–69  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

52}
53
54func (w *LinePrefixLogger) Write(p []byte) (n int, err error) {
55 for _, line := range strings.Split(string(p), "\n") {
56 // Skip empty lines.
57 line = strings.TrimSpace(line)
58 if line == "" {
59 continue
60 }
61
62 // Write the prefix + line to the wrapped writer.
63 if err := w.logger.Log(w.prefix + line); err != nil {
64 return 0, err
65 }
66 }
67
68 return len(p), nil
69}

Callers 4

generateNameFunction · 0.80
LogMethod · 0.80
TestWaitSumMetricFunction · 0.80
TestWaitSumMetric_NanFunction · 0.80

Calls 1

LogMethod · 0.65

Tested by 2

TestWaitSumMetricFunction · 0.64
TestWaitSumMetric_NanFunction · 0.64