Skip to content

Commit

Permalink
Set log level more concisely
Browse files Browse the repository at this point in the history
  • Loading branch information
kotx committed Dec 8, 2024
1 parent a6c9533 commit 37994fa
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cmd/proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"net/http"
"net/http/httputil"
"net/url"
"os"
"strings"

"tailscale.com/client/tailscale"
Expand All @@ -19,10 +18,8 @@ var tsHost = flag.String("hostname", "dex", "hostname to use in the tailnet")
var endpoint = flag.String("endpoint", "http://dex:5556", "the Dex host to proxy requests to")

func main() {
logger := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
Level: slog.Level(*logLevel),
}))
slog.SetDefault(logger)
logLevel := slog.Level(*logLevel)
slog.SetLogLoggerLevel(logLevel)

flag.Parse()
if *endpoint == "" {
Expand Down

0 comments on commit 37994fa

Please sign in to comment.