Skip to content

Commit

Permalink
chore: update x/slog import to log/slog
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <[email protected]>
  • Loading branch information
gfanton committed Feb 13, 2024
1 parent 455148b commit 130a7ef
Show file tree
Hide file tree
Showing 54 changed files with 72 additions and 144 deletions.
6 changes: 2 additions & 4 deletions contribs/gnodev/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ replace github.com/gnolang/gno => ../..
require (
github.com/fsnotify/fsnotify v1.7.0
github.com/gnolang/gno v0.0.0-00010101000000-000000000000
go.uber.org/zap v1.24.0
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3
go.uber.org/zap v1.26.0
golang.org/x/term v0.16.0
)

Expand Down Expand Up @@ -56,9 +55,8 @@ require (
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
go.opencensus.io v0.22.5 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap/exp v0.1.0 // indirect
go.uber.org/zap/exp v0.2.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.20.0 // indirect
Expand Down
18 changes: 6 additions & 12 deletions contribs/gnodev/go.sum

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

2 changes: 1 addition & 1 deletion contribs/gnodev/pkg/dev/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dev
import (
"context"
"fmt"
"log/slog"

"github.com/gnolang/gno/gno.land/pkg/gnoland"
"github.com/gnolang/gno/gno.land/pkg/integration"
Expand All @@ -16,7 +17,6 @@ import (
bft "github.com/gnolang/gno/tm2/pkg/bft/types"
"github.com/gnolang/gno/tm2/pkg/crypto"
"github.com/gnolang/gno/tm2/pkg/std"
"golang.org/x/exp/slog"
// backup "github.com/gnolang/tx-archive/backup/client"
// restore "github.com/gnolang/tx-archive/restore/client"
)
Expand Down
1 change: 0 additions & 1 deletion contribs/gnokeykc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ require (
go.etcd.io/bbolt v1.3.8 // indirect
go.opencensus.io v0.22.5 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
Expand Down
5 changes: 1 addition & 4 deletions contribs/gnokeykc/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 gno.land/pkg/gnoland/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ package gnoland

import (
"fmt"
"log/slog"
"path/filepath"

"golang.org/x/exp/slog"

"github.com/gnolang/gno/gno.land/pkg/sdk/vm"
"github.com/gnolang/gno/gnovm/pkg/gnoenv"
"github.com/gnolang/gno/tm2/pkg/amino"
Expand Down
3 changes: 1 addition & 2 deletions gno.land/pkg/gnoland/node_inmemory.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package gnoland

import (
"fmt"
"log/slog"
"sync"
"time"

"golang.org/x/exp/slog"

abci "github.com/gnolang/gno/tm2/pkg/bft/abci/types"
tmcfg "github.com/gnolang/gno/tm2/pkg/bft/config"
"github.com/gnolang/gno/tm2/pkg/bft/node"
Expand Down
3 changes: 1 addition & 2 deletions gno.land/pkg/gnoweb/gnoweb.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ import (
"fmt"
"io"
"io/fs"
"log/slog"
"net/http"
"os"
"path/filepath"
"runtime"
"strings"
"time"

"golang.org/x/exp/slog"

"github.com/gnolang/gno/tm2/pkg/amino"
abci "github.com/gnolang/gno/tm2/pkg/bft/abci/types"
"github.com/gnolang/gno/tm2/pkg/bft/rpc/client"
Expand Down
3 changes: 1 addition & 2 deletions gno.land/pkg/integration/testing_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import (
"errors"
"fmt"
"hash/crc32"
"log/slog"
"os"
"path/filepath"
"strconv"
"strings"
"testing"

"golang.org/x/exp/slog"

"github.com/gnolang/gno/gno.land/pkg/gnoland"
"github.com/gnolang/gno/gno.land/pkg/keyscli"
"github.com/gnolang/gno/gno.land/pkg/log"
Expand Down
3 changes: 1 addition & 2 deletions gno.land/pkg/integration/testing_node.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package integration

import (
"log/slog"
"path/filepath"
"time"

"golang.org/x/exp/slog"

"github.com/gnolang/gno/gno.land/pkg/gnoland"
abci "github.com/gnolang/gno/tm2/pkg/bft/abci/types"
tmcfg "github.com/gnolang/gno/tm2/pkg/bft/config"
Expand Down
5 changes: 2 additions & 3 deletions gno.land/pkg/log/zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package log

import (
"io"

"golang.org/x/exp/slog"
"log/slog"

"go.uber.org/zap"
"go.uber.org/zap/exp/zapslog"
Expand Down Expand Up @@ -72,5 +71,5 @@ func NewZapLogger(enc zapcore.Encoder, w io.Writer, level zapcore.Level, opts ..

// ZapLoggerToSlog wraps the given zap logger to an log/slog Logger
func ZapLoggerToSlog(logger *zap.Logger) *slog.Logger {
return slog.New(zapslog.NewHandler(logger.Core()))
return slog.New(zapslog.NewHandler(logger.Core(), nil))

Check warning on line 74 in gno.land/pkg/log/zap.go

View check run for this annotation

Codecov / codecov/patch

gno.land/pkg/log/zap.go#L74

Added line #L74 was not covered by tests
}
7 changes: 2 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ require (
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c
go.etcd.io/bbolt v1.3.8
go.uber.org/multierr v1.10.0
go.uber.org/zap v1.24.0
go.uber.org/zap/exp v0.1.0
go.uber.org/zap v1.26.0
go.uber.org/zap/exp v0.2.0
golang.org/x/crypto v0.18.0
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3
golang.org/x/mod v0.14.0
golang.org/x/net v0.20.0
golang.org/x/term v0.16.0
Expand Down Expand Up @@ -72,13 +71,11 @@ require (
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/gorilla/sessions v1.2.1 // indirect
github.com/klauspost/compress v1.12.3 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/nxadm/tail v1.4.11 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
go.opencensus.io v0.22.5 // indirect
go.uber.org/atomic v1.10.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
Expand Down
19 changes: 6 additions & 13 deletions go.sum

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

5 changes: 2 additions & 3 deletions misc/devdeps/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,8 @@ require (
github.com/yuin/goldmark v1.4.13 // indirect
gitlab.com/bosi/decorder v0.4.0 // indirect
go.tmz.dev/musttag v0.7.2 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.24.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect
golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect
golang.org/x/mod v0.12.0 // indirect
Expand Down
17 changes: 6 additions & 11 deletions misc/devdeps/go.sum

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

1 change: 0 additions & 1 deletion misc/loop/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ require (
go.uber.org/zap v1.26.0 // indirect
go.uber.org/zap/exp v0.2.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions misc/loop/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 tm2/pkg/bft/abci/example/kvstore/persistent_kvstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ package kvstore
import (
"encoding/base64"
"fmt"
"log/slog"
"strconv"
"strings"

"golang.org/x/exp/slog"

"github.com/gnolang/gno/tm2/pkg/amino"
"github.com/gnolang/gno/tm2/pkg/bft/abci/example/errors"
abci "github.com/gnolang/gno/tm2/pkg/bft/abci/types"
Expand Down
3 changes: 1 addition & 2 deletions tm2/pkg/bft/blockchain/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ package blockchain
import (
"errors"
"fmt"
"log/slog"
"math"
"sync"
"sync/atomic"
"time"

"golang.org/x/exp/slog"

"github.com/gnolang/gno/tm2/pkg/bft/types"
"github.com/gnolang/gno/tm2/pkg/flow"
"github.com/gnolang/gno/tm2/pkg/log"
Expand Down
Loading

0 comments on commit 130a7ef

Please sign in to comment.