Skip to content

Commit

Permalink
fix: Simplified slog level from go1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
betamos committed Feb 28, 2024
1 parent 3af4dd6 commit a06eec0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit a06eec0

Please sign in to comment.