(out io.Writer, opts *Options)
| 34 | } |
| 35 | |
| 36 | func New(out io.Writer, opts *Options) *IndentHandler { |
| 37 | h := &IndentHandler{out: out, mu: &sync.Mutex{}} |
| 38 | if opts != nil { |
| 39 | h.opts = *opts |
| 40 | } |
| 41 | if h.opts.Level == nil { |
| 42 | h.opts.Level = slog.LevelInfo |
| 43 | } |
| 44 | return h |
| 45 | } |
| 46 | |
| 47 | func (h *IndentHandler) Enabled(ctx context.Context, level slog.Level) bool { |
| 48 | return level >= h.opts.Level.Level() |
no outgoing calls