Skip to content

Commit

Permalink
treewide: use log/slog instead of golang.org/x/exp/slog
Browse files Browse the repository at this point in the history
Now that we are using Go v1.21, we can use the `log/slog` from the
standard library instead of the experimental package.

Signed-off-by: Robin Hahling <[email protected]>
  • Loading branch information
rolinh committed Aug 9, 2023
1 parent b6c37bd commit c1b81e0
Show file tree
Hide file tree
Showing 20 changed files with 7 additions and 2,913 deletions.
2 changes: 1 addition & 1 deletion cmd/observe/io_reader_observer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package observe
import (
"context"
"io"
"log/slog"
"strings"
"testing"

Expand All @@ -14,7 +15,6 @@ import (
"github.com/cilium/hubble/pkg/logger"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/exp/slog"
"google.golang.org/protobuf/types/known/timestamppb"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package cmd

import (
"log/slog"
"os"

"github.com/cilium/hubble/cmd/common/config"
Expand All @@ -20,7 +21,6 @@ import (
"github.com/cilium/hubble/cmd/watch"
"github.com/cilium/hubble/pkg"
"github.com/cilium/hubble/pkg/logger"
"golang.org/x/exp/slog"
"google.golang.org/grpc"

"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b
golang.org/x/sys v0.11.0
google.golang.org/grpc v1.57.0
google.golang.org/protobuf v1.31.0
Expand Down Expand Up @@ -66,6 +65,7 @@ require (
github.com/vishvananda/netns v0.0.4 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.mongodb.org/mongo-driver v1.11.3 // indirect
golang.org/x/exp v0.0.0-20230809094429-853ea248256d // indirect
golang.org/x/net v0.11.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/text v0.10.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
package logger

import (
"log/slog"
"sync"

"golang.org/x/exp/slog" // TODO use std library once Go v1.21 is out
)

var (
Expand Down
102 changes: 0 additions & 102 deletions vendor/golang.org/x/exp/slog/attr.go

This file was deleted.

Loading

0 comments on commit c1b81e0

Please sign in to comment.