mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-04 14:08:39 +00:00
log: return TerminalHandler write errors from Handle (#35055)
Propagate slog Handle failures when the underlying io.Writer rejects output.
This commit is contained in:
parent
f4a90d178a
commit
ab20d50dba
1 changed files with 2 additions and 2 deletions
|
|
@ -77,9 +77,9 @@ func (h *TerminalHandler) Handle(_ context.Context, r slog.Record) error {
|
||||||
h.mu.Lock()
|
h.mu.Lock()
|
||||||
defer h.mu.Unlock()
|
defer h.mu.Unlock()
|
||||||
buf := h.format(h.buf, r, h.useColor)
|
buf := h.format(h.buf, r, h.useColor)
|
||||||
h.wr.Write(buf)
|
_, err := h.wr.Write(buf)
|
||||||
h.buf = buf[:0]
|
h.buf = buf[:0]
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *TerminalHandler) Enabled(_ context.Context, level slog.Level) bool {
|
func (h *TerminalHandler) Enabled(_ context.Context, level slog.Level) bool {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue