MCPcopy Index your code
hub / github.com/coder/slog / Write

Method Write

s.go:38–47  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

36}
37
38func (w stdlogWriter) Write(p []byte) (n int, err error) {
39 msg := string(p)
40 // stdlib includes a trailing newline on the msg that
41 // we do not want.
42 msg = strings.TrimSuffix(msg, "\n")
43
44 w.l.log(w.ctx, w.level, msg, nil)
45
46 return len(p), nil
47}

Callers 5

MarshalJSONMethod · 0.45
marshalListFunction · 0.45
LogEntryMethod · 0.45
LogEntryMethod · 0.45
LogEntryMethod · 0.45

Calls 1

logMethod · 0.80

Tested by

no test coverage detected