diff --git a/config_test.go b/config_test.go index d7cff99..d369622 100644 --- a/config_test.go +++ b/config_test.go @@ -56,6 +56,7 @@ func TestConfigNewHandlerOptions(t *testing.T) { // go test -v -cover -count=1 -test.cpu=1 -run=^TestConfigNewHandler$ func TestConfigNewHandler(t *testing.T) { handlerName := t.Name() + RegisterHandler(handlerName, func(w io.Writer, opts *slog.HandlerOptions) slog.Handler { return &testConfigHandler{ w: w, diff --git a/option.go b/option.go index 5436d9f..62e0edf 100644 --- a/option.go +++ b/option.go @@ -171,14 +171,14 @@ func WithHandler(handler string) Option { // WithTextHandler sets text handler to config. func WithTextHandler() Option { return func(conf *config) { - conf.handler = "text" + conf.handler = handlerText } } // WithJsonHandler sets json handler to config. func WithJsonHandler() Option { return func(conf *config) { - conf.handler = "json" + conf.handler = handlerJson } }