Skip to content

Commit

Permalink
fixed #21
Browse files Browse the repository at this point in the history
  • Loading branch information
lmittmann committed May 17, 2023
1 parent e783b15 commit 8e6f45e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func NewHandler(w io.Writer, opts *Options) slog.Handler {

h.addSource = opts.AddSource
if opts.Level != nil {
h.level = opts.Level.Level()
h.level = opts.Level
}
h.replaceAttr = opts.ReplaceAttr
if opts.TimeFormat != "" {
Expand All @@ -98,7 +98,7 @@ type handler struct {
w io.Writer

addSource bool
level slog.Level
level slog.Leveler
replaceAttr func([]string, slog.Attr) slog.Attr
timeFormat string
noColor bool
Expand All @@ -119,7 +119,7 @@ func (h *handler) clone() *handler {
}

func (h *handler) Enabled(_ context.Context, level slog.Level) bool {
return level >= h.level
return level >= h.level.Level()
}

func (h *handler) Handle(_ context.Context, r slog.Record) error {
Expand Down

0 comments on commit 8e6f45e

Please sign in to comment.