MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / writeError

Method writeError

logger/handler.go:212–224  ·  view source on GitHub ↗

writeError writes a logging error message to STDERR.

(err error)

Source from the content-addressed store, hash-verified

210
211// writeError writes a logging error message to STDERR.
212func (h *Handler) writeError(err error) {
213 buf := newBuffer()
214 defer func() {
215 buf.free()
216 }()
217
218 r := slog.NewRecord(time.Now(), slog.LevelError, "An error occurred during logging", 0)
219 r.Add("error", err)
220
221 h.format(r, buf)
222
223 _, _ = os.Stderr.Write(*buf)
224}
225
226// withGroup returns a new handler with the given attribute group added.
227func (h *Handler) withGroup(group attrGroup) *Handler {

Callers 1

HandleMethod · 0.95

Calls 5

formatMethod · 0.95
freeMethod · 0.80
AddMethod · 0.80
newBufferFunction · 0.70
WriteMethod · 0.45

Tested by

no test coverage detected