From fb7409639f0274efe3aa95574968972d103c9f9f Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Sat, 21 Dec 2024 14:22:56 +0100 Subject: [PATCH] use slog.default --- ext/dispatcher.go | 3 +-- ext/updater.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ext/dispatcher.go b/ext/dispatcher.go index 29655f1..e427a6a 100644 --- a/ext/dispatcher.go +++ b/ext/dispatcher.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "log/slog" - "os" "runtime/debug" "strings" "sync" @@ -128,7 +127,7 @@ func NewDispatcher(opts *DispatcherOpts) *Dispatcher { var errHandler DispatcherErrorHandler var panicHandler DispatcherPanicHandler var unhandledErrFunc ErrorFunc - logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) + logger := slog.Default() maxRoutines := DefaultMaxRoutines processor := Processor(BaseProcessor{}) diff --git a/ext/updater.go b/ext/updater.go index 7a92cfa..803b10a 100644 --- a/ext/updater.go +++ b/ext/updater.go @@ -8,7 +8,6 @@ import ( "log/slog" "net" "net/http" - "os" "strconv" "strings" "time" @@ -62,7 +61,7 @@ type UpdaterOpts struct { // NewUpdater Creates a new Updater, as well as a Dispatcher and any optional updater configurations (via UpdaterOpts). func NewUpdater(dispatcher UpdateDispatcher, opts *UpdaterOpts) *Updater { var unhandledErrFunc ErrorFunc - logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) + logger := slog.Default() if opts != nil { unhandledErrFunc = opts.UnhandledErrFunc