Fmt returns a human readable format for ent. Assumes we have a bytes.Buffer which we will more easily be able to assume underlying reallocation of it's size is possible if necessary than for an arbitrary io.Writer/io.StringWriter Note that while bytes.Buffer can in theory return an error for writes,
(buf *bytes.Buffer, termW io.Writer, ent slog.SinkEntry)
| 196 | // for extra lines in a log so if we did it here, the fields would be indented |
| 197 | // twice in test logs. So the Stderr logger indents all the fields itself. |
| 198 | func Fmt(buf *bytes.Buffer, termW io.Writer, ent slog.SinkEntry) { |
| 199 | Formatter{}.Fmt(buf, termW, ent) |
| 200 | } |
| 201 | |
| 202 | func (f Formatter) Fmt(buf *bytes.Buffer, termW io.Writer, ent slog.SinkEntry) { |
| 203 | reset(buf, termW) |