diff --git a/cli/log.go b/cli/log.go index 094c5604..d353f056 100644 --- a/cli/log.go +++ b/cli/log.go @@ -3,7 +3,7 @@ package main import ( "net/http" - "golang.org/x/exp/slog" + "log/slog" ) type LogRoundTripper struct { diff --git a/cli/login.go b/cli/login.go index 6982ff86..0c3da7ab 100644 --- a/cli/login.go +++ b/cli/login.go @@ -5,10 +5,11 @@ import ( "fmt" "os" + "log/slog" + "github.com/pkg/browser" "github.com/spf13/cobra" "github.com/spf13/pflag" - "golang.org/x/exp/slog" ) var ( diff --git a/cli/main.go b/cli/main.go index e9d9ce54..0039afc2 100644 --- a/cli/main.go +++ b/cli/main.go @@ -7,8 +7,9 @@ import ( "strings" "syscall" + "log/slog" + "github.com/spf13/cobra" - "golang.org/x/exp/slog" ) const ( diff --git a/cli/oauth2.go b/cli/oauth2.go index 6aa1b442..1e48fb56 100644 --- a/cli/oauth2.go +++ b/cli/oauth2.go @@ -9,6 +9,7 @@ import ( "encoding/json" "errors" "fmt" + "log/slog" "net" "net/http" "net/url" @@ -165,9 +166,14 @@ var ErrNoPortsAvailable = errors.New("no ports available") func findFirstFreePort(ctx context.Context, broadcastAddr string, ports []string) (net.Listener, error) { var lc net.ListenConfig for _, port := range ports { - sock, err := lc.Listen(ctx, "tcp4", net.JoinHostPort(broadcastAddr, port)) + addr := net.JoinHostPort(broadcastAddr, port) + slog.Debug("opening connection", slog.String("addr", addr)) + sock, err := lc.Listen(ctx, "tcp4", addr) if err == nil { + slog.Debug("listening", slog.String("addr", addr)) return sock, nil + } else { + slog.Debug("could not listen, trying a different addr", slog.String("addr", addr), slog.String("error", err.Error())) } } diff --git a/internal/api/http.go b/internal/api/http.go index de45e189..45770843 100644 --- a/internal/api/http.go +++ b/internal/api/http.go @@ -4,7 +4,7 @@ import ( "net/http" "strings" - "golang.org/x/exp/slog" + "log/slog" ) // RequestAttrs returns attributes to be used with slog for the given request. diff --git a/internal/api/json.go b/internal/api/json.go index aedcfff7..02fe07ad 100644 --- a/internal/api/json.go +++ b/internal/api/json.go @@ -4,7 +4,7 @@ import ( "encoding/json" "net/http" - "golang.org/x/exp/slog" + "log/slog" ) func ServeJSON[T any](w http.ResponseWriter, data T) { diff --git a/internal/api/serverless_functions.go b/internal/api/serverless_functions.go index a999c790..ac568d5b 100644 --- a/internal/api/serverless_functions.go +++ b/internal/api/serverless_functions.go @@ -6,8 +6,9 @@ import ( "net/http" "strings" + "log/slog" + "github.com/okta/okta-sdk-golang/v2/okta" - "golang.org/x/exp/slog" ) type Application struct { diff --git a/lambda/list_applications/main.go b/lambda/list_applications/main.go index 8eb1decd..0901e609 100644 --- a/lambda/list_applications/main.go +++ b/lambda/list_applications/main.go @@ -5,10 +5,11 @@ import ( "net/url" "os" + "log/slog" + "github.com/aws/aws-lambda-go/lambda" "github.com/riotgames/key-conjurer/internal" "github.com/riotgames/key-conjurer/internal/api" - "golang.org/x/exp/slog" ) func main() {