... and copy patterns too

This commit is contained in:
Jared Wasinger 2023-11-15 16:31:18 +08:00
parent e25cb5ce80
commit 3b7e759215

View file

@ -152,9 +152,12 @@ func (h *GlogHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
}
h.lock.RUnlock()
patterns := []pattern{}
patterns = append(patterns, h.patterns...)
res := GlogHandler{
origin: h.origin.WithAttrs(attrs),
patterns: h.patterns,
patterns: patterns,
siteCache: siteCache,
location: h.location,
}