mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
log: actually use glogWithAttrs
This commit is contained in:
parent
552c033e64
commit
f3893994c1
1 changed files with 1 additions and 7 deletions
|
|
@ -202,13 +202,7 @@ func (h *GlogHandler) handle(ctx context.Context, r slog.Record, origin slog.Han
|
||||||
// Note the handler created here will still listen to Verbosity and Vmodule settings
|
// Note the handler created here will still listen to Verbosity and Vmodule settings
|
||||||
// done on the original handler.
|
// done on the original handler.
|
||||||
func (h *GlogHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
|
func (h *GlogHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
|
||||||
// fork the log config at this point
|
return &glogWithAttrs{base: h, origin: h.origin.WithAttrs(attrs)}
|
||||||
cfg := h.config.Load()
|
|
||||||
newcfg := &glogConfig{level: cfg.level, patterns: cfg.patterns}
|
|
||||||
|
|
||||||
sub := GlogHandler{origin: h.origin.WithAttrs(attrs)}
|
|
||||||
sub.config.Store(newcfg)
|
|
||||||
return &sub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type glogWithAttrs struct{
|
type glogWithAttrs struct{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue