From a06eec0da2c1e0fb3b6f9546dc224f95fceaaa5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Didrik=20Nordstr=C3=B6m?= Date: Wed, 28 Feb 2024 16:00:26 +0100 Subject: [PATCH] fix: Simplified slog level from go1.22 --- cmd/main.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 2390220..4905c98 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -38,14 +38,9 @@ func main() { flag.Parse() if *verbose { - // TODO(go1.22): Use SetLogLoggerLevel(slog.LevelDebug) instead - var level = new(slog.LevelVar) // Info by default - level.Set(slog.LevelDebug) - h := slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: level}) - slog.SetDefault(slog.New(h)) - } else { - log.SetFlags(log.Ltime) + slog.SetLogLoggerLevel(slog.LevelDebug) } + log.SetFlags(log.Ltime) ty := zeroconf.NewType(*typeStr) svc := zeroconf.NewService(ty, *name, uint16(*port))