diff --git a/baseapp/grpcrouter_test.go b/baseapp/grpcrouter_test.go index 860e7bbe75c..dede24b7bc1 100644 --- a/baseapp/grpcrouter_test.go +++ b/baseapp/grpcrouter_test.go @@ -2,11 +2,10 @@ package baseapp_test import ( "context" - "os" "sync" "testing" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" @@ -59,7 +58,7 @@ func TestRegisterQueryServiceTwice(t *testing.T) { err := depinject.Inject(makeMinimalConfig(), &appBuilder) require.NoError(t, err) db := dbm.NewMemDB() - app := appBuilder.Build(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil) + app := appBuilder.Build(log.NewLogger(), db, nil) // First time registering service shouldn't panic. require.NotPanics(t, func() { diff --git a/baseapp/msg_service_router_test.go b/baseapp/msg_service_router_test.go index 45e4832b1a1..c361af9d667 100644 --- a/baseapp/msg_service_router_test.go +++ b/baseapp/msg_service_router_test.go @@ -1,16 +1,15 @@ package baseapp_test import ( - "os" "testing" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" "cosmossdk.io/depinject" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -29,7 +28,7 @@ func TestRegisterMsgService(t *testing.T) { ) err := depinject.Inject(makeMinimalConfig(), &appBuilder, ®istry) require.NoError(t, err) - app := appBuilder.Build(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), dbm.NewMemDB(), nil) + app := appBuilder.Build(log.NewLogger(), dbm.NewMemDB(), nil) require.Panics(t, func() { testdata.RegisterMsgServer( @@ -58,7 +57,7 @@ func TestRegisterMsgServiceTwice(t *testing.T) { err := depinject.Inject(makeMinimalConfig(), &appBuilder, ®istry) require.NoError(t, err) db := dbm.NewMemDB() - app := appBuilder.Build(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil) + app := appBuilder.Build(log.NewLogger(), db, nil) testdata.RegisterInterfaces(registry) // First time registering service shouldn't panic. diff --git a/baseapp/utils_test.go b/baseapp/utils_test.go index 53eb3cfaab3..1ad067c7bcf 100644 --- a/baseapp/utils_test.go +++ b/baseapp/utils_test.go @@ -8,7 +8,6 @@ import ( "errors" "fmt" "net/url" - "os" "reflect" "strconv" "testing" @@ -21,12 +20,12 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" - "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/baseapp" baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil" "github.com/cosmos/cosmos-sdk/client" @@ -55,7 +54,7 @@ var ParamStoreKey = []byte("paramstore") func defaultLogger() log.Logger { if testing.Verbose() { - return log.NewTMLogger(log.NewSyncWriter(os.Stdout)).With("module", "baseapp/test") + return log.NewLoggerWithKV("module", "baseapp/test") } return log.NewNopLogger() diff --git a/client/pruning/main.go b/client/pruning/main.go index 0a3d6f0e8a6..ec996ef5dd0 100644 --- a/client/pruning/main.go +++ b/client/pruning/main.go @@ -2,15 +2,14 @@ package pruning import ( "fmt" - "os" "path/filepath" "github.com/spf13/cobra" "github.com/spf13/viper" + "cosmossdk.io/log" pruningtypes "cosmossdk.io/store/pruning/types" "cosmossdk.io/store/rootmulti" - "github.com/cometbft/cometbft/libs/log" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/client/flags" @@ -62,7 +61,7 @@ func Cmd(appCreator servertypes.AppCreator) *cobra.Command { return err } - logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) + logger := log.NewLogger() app := appCreator(logger, db, nil, vp) cms := app.CommitMultiStore() diff --git a/client/v2/go.mod b/client/v2/go.mod index aca5b91298f..2356e793dff 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -19,7 +19,7 @@ require ( require ( cosmossdk.io/collections v0.0.0-20230214153846-b6c6e4e99177 // indirect cosmossdk.io/errors v1.0.0-beta.7 // indirect - cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 // indirect + cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f // indirect cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 // indirect cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 // indirect filippo.io/edwards25519 v1.0.0 // indirect diff --git a/client/v2/go.sum b/client/v2/go.sum index 706528bcfca..9a1b9dec8d5 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -45,8 +45,8 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 h1:Scox9JfANgkuAO0F9LMH0e0W5ijmp2BQbsok/U+jDUo= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78/go.mod h1:MyvZ6k9eL0azI/yf8m5gqsM8PgbtFmqjire1OxUMkmc= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= diff --git a/go.mod b/go.mod index fe27932eb50..25c02235d0a 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( cosmossdk.io/core v0.5.1 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7 - cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 + cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 - cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 + cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 cosmossdk.io/x/tx v0.2.0 github.com/99designs/keyring v1.2.1 github.com/armon/go-metrics v0.4.1 diff --git a/go.sum b/go.sum index 853c6179a51..f8f944fe956 100644 --- a/go.sum +++ b/go.sum @@ -45,12 +45,12 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 h1:Scox9JfANgkuAO0F9LMH0e0W5ijmp2BQbsok/U+jDUo= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78/go.mod h1:MyvZ6k9eL0azI/yf8m5gqsM8PgbtFmqjire1OxUMkmc= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.0 h1:53f5TIXhpPYJGMm47SUslcV2i8JNBEN3eE08BmxE/Zg= cosmossdk.io/x/tx v0.2.0/go.mod h1:CTko7wgt7aBdbxOesZ+Wo1uO/03ueKzIQ0iI323Rqgk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -630,8 +630,8 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= diff --git a/log/README.md b/log/README.md index e019c03bea4..c06f26e933b 100644 --- a/log/README.md +++ b/log/README.md @@ -1,3 +1,3 @@ # Log -The `cosmossdk.io/log` provides simple logging implementations for the Cosmos SDK and Cosmos SDK modules. \ No newline at end of file +The `cosmossdk.io/log` provides a zerolog logging implementation for the Cosmos SDK and Cosmos SDK modules. diff --git a/log/bench_test.go b/log/bench_test.go index ed3fa9303fc..5e6beb8b430 100644 --- a/log/bench_test.go +++ b/log/bench_test.go @@ -2,6 +2,7 @@ package log_test import ( "bytes" + "errors" "io" "testing" "time" @@ -10,6 +11,8 @@ import ( "github.com/rs/zerolog" ) +const message = "test message" + func BenchmarkLoggers(b *testing.B) { b.ReportAllocs() @@ -61,14 +64,13 @@ func BenchmarkLoggers(b *testing.B) { }, }...) - const message = "test message" - // If running with "go test -v", print out the log messages as a sanity check. if testing.Verbose() { checkBuf := new(bytes.Buffer) for _, bc := range benchCases { checkBuf.Reset() - logger := log.ZeroLogWrapper{Logger: zerolog.New(checkBuf)} + zl := zerolog.New(checkBuf) + logger := log.ZeroLogWrapper{Logger: &zl} logger.Info(message, bc.keyVals...) b.Logf("zero logger output for %s: %s", bc.name, checkBuf.String()) @@ -82,23 +84,8 @@ func BenchmarkLoggers(b *testing.B) { for _, bc := range benchCases { bc := bc b.Run(bc.name, func(b *testing.B) { - logger := log.ZeroLogWrapper{Logger: zerolog.New(io.Discard)} - - for i := 0; i < b.N; i++ { - logger.Info(message, bc.keyVals...) - } - }) - } - }) - - // zerolog offers a no-op writer. - // It appears to be slower than our custom NopLogger, - // so include it in the nop benchmarks as a point of reference. - b.Run("zerolog nop", func(b *testing.B) { - for _, bc := range nopCases { - bc := bc - b.Run(bc.name, func(b *testing.B) { - logger := log.ZeroLogWrapper{Logger: zerolog.Nop()} + zl := zerolog.New(io.Discard) + logger := log.ZeroLogWrapper{Logger: &zl} for i := 0; i < b.N; i++ { logger.Info(message, bc.keyVals...) @@ -122,3 +109,32 @@ func BenchmarkLoggers(b *testing.B) { } }) } + +func BenchmarkLoggers_StructuredVsFields(b *testing.B) { + b.ReportAllocs() + + b.Run("logger structured", func(b *testing.B) { + zl := zerolog.New(io.Discard) + var logger log.Logger = log.ZeroLogWrapper{Logger: &zl} + for i := 0; i < b.N; i++ { + logger.Impl().Info().Int64("foo", 100000).Msg(message) + logger.Impl().Info().Str("foo", "foo").Msg(message) + logger.Impl().Error(). + Int64("foo", 100000). + Str("bar", "foo"). + Bytes("other", []byte{0xde, 0xad, 0xbe, 0xef}). + Err(errors.New("error")). + Msg(message) + } + }) + + b.Run("logger", func(b *testing.B) { + zl := zerolog.New(io.Discard) + var logger log.Logger = log.ZeroLogWrapper{Logger: &zl} + for i := 0; i < b.N; i++ { + logger.Info(message, "foo", 100000) + logger.Info(message, "foo", "foo") + logger.Error(message, "foo", 100000, "bar", "foo", "other", []byte{0xde, 0xad, 0xbe, 0xef}, "error", errors.New("error")) + } + }) +} diff --git a/log/go.mod b/log/go.mod index fa553c0fc7d..e98e6470b17 100644 --- a/log/go.mod +++ b/log/go.mod @@ -2,16 +2,10 @@ module cosmossdk.io/log go 1.19 -require ( - github.com/cometbft/cometbft v0.37.0-alpha.3 - github.com/rs/zerolog v1.29.0 -) +require github.com/rs/zerolog v1.29.0 require ( - github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.16 // indirect - github.com/pkg/errors v0.9.1 // indirect golang.org/x/sys v0.5.0 // indirect ) diff --git a/log/go.sum b/log/go.sum index 3c6c29508e3..f2a3d868ecd 100644 --- a/log/go.sum +++ b/log/go.sum @@ -1,11 +1,4 @@ -github.com/cometbft/cometbft v0.37.0-alpha.3 h1:74F+cMr4pd1a2lFn/h4TxXmO8VWi3A2dxyoMcjlMWuQ= -github.com/cometbft/cometbft v0.37.0-alpha.3/go.mod h1:dUGbIGYoLM11xUruTTJY4Xp9FHh6Nfu3Nots8/+UNSo= github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= -github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -13,16 +6,12 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w= github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/log/logger.go b/log/logger.go index 812d1e8fa20..aebef5c2f81 100644 --- a/log/logger.go +++ b/log/logger.go @@ -1,12 +1,89 @@ package log -import cmtlog "github.com/cometbft/cometbft/libs/log" +import ( + "os" + "time" + + "github.com/rs/zerolog" +) + +// Defines commons keys for logging +const ModuleKey = "module" + +// ContextKey is used to store the logger in the context +var ContextKey struct{} -// Logger is the interface that wraps the basic logging methods. type Logger interface { - Debug(msg string, keyvals ...interface{}) - Info(msg string, keyvals ...interface{}) - Error(msg string, keyvals ...interface{}) + Info(msg string, keyVals ...interface{}) + Error(msg string, keyVals ...interface{}) + Debug(msg string, keyVals ...interface{}) + With(keyVals ...interface{}) Logger + + Level(lvl zerolog.Level) Logger + Impl() *zerolog.Logger +} + +type ZeroLogWrapper struct { + *zerolog.Logger +} + +// NewNopLogger returns a new logger that does nothing +func NewNopLogger() Logger { + logger := zerolog.Nop() + return ZeroLogWrapper{&logger} +} + +// NewLogger returns a new logger +func NewLogger() Logger { + output := zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.Kitchen} + logger := zerolog.New(output).With().Timestamp().Logger() + return ZeroLogWrapper{&logger} +} + +// NewLoggerWithKV returns a new logger with the given key/value pair +func NewLoggerWithKV(key, value string) Logger { + output := zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.Kitchen} + logger := zerolog.New(output).With().Str(key, value).Timestamp().Logger() + return ZeroLogWrapper{&logger} +} + +// NewCustomLogger returns a new logger with the given zerolog logger +func NewCustomLogger(logger zerolog.Logger) Logger { + return ZeroLogWrapper{&logger} +} + +// Info takes a message and a set of key/value pairs and logs with level INFO. +// The key of the tuple must be a string. +func (l ZeroLogWrapper) Info(msg string, keyVals ...interface{}) { + l.Logger.Info().Fields(keyVals).Msg(msg) +} + +// Error takes a message and a set of key/value pairs and logs with level DEBUG. +// The key of the tuple must be a string. +func (l ZeroLogWrapper) Error(msg string, keyVals ...interface{}) { + l.Logger.Error().Fields(keyVals).Msg(msg) +} + +// Debug takes a message and a set of key/value pairs and logs with level ERR. +// The key of the tuple must be a string. +func (l ZeroLogWrapper) Debug(msg string, keyVals ...interface{}) { + l.Logger.Debug().Fields(keyVals).Msg(msg) +} + +// With returns a new wrapped logger with additional context provided by a set +func (l ZeroLogWrapper) With(keyVals ...interface{}) Logger { + logger := l.Logger.With().Fields(keyVals).Logger() + return ZeroLogWrapper{&logger} +} + +// Level returns a new wrapped logger with the given level +func (l ZeroLogWrapper) Level(lvl zerolog.Level) Logger { + logger := l.Logger.Level(lvl) + return ZeroLogWrapper{&logger} +} - With(keyvals ...interface{}) cmtlog.Logger +// Impl returns the underlying zerolog logger +// It can be used to used zerolog structured API directly instead of the wrapper +func (l ZeroLogWrapper) Impl() *zerolog.Logger { + return l.Logger } diff --git a/log/noop_logger.go b/log/noop_logger.go deleted file mode 100644 index a1ffb0a8334..00000000000 --- a/log/noop_logger.go +++ /dev/null @@ -1,19 +0,0 @@ -package log - -import cmlog "github.com/cometbft/cometbft/libs/log" - -var _ Logger = NoOp{} - -type NoOp struct{} - -func NewNopLogger() Logger { - return &NoOp{} -} - -func (l NoOp) Debug(msg string, keyvals ...interface{}) {} -func (l NoOp) Info(msg string, keyvals ...interface{}) {} -func (l NoOp) Error(msg string, keyvals ...interface{}) {} - -func (l NoOp) With(i ...interface{}) cmlog.Logger { - return l -} diff --git a/log/testing.go b/log/testing.go new file mode 100644 index 00000000000..adeb7a64988 --- /dev/null +++ b/log/testing.go @@ -0,0 +1,20 @@ +package log + +import "testing" + +// reuse the same logger across all tests +var _testingLogger Logger + +func NewTestingLogger() Logger { + if _testingLogger != nil { + return _testingLogger + } + + if testing.Verbose() { + _testingLogger = NewLogger() + } else { + _testingLogger = NewNopLogger() + } + + return _testingLogger +} diff --git a/log/zerolog.go b/log/zerolog.go deleted file mode 100644 index d3d60105d55..00000000000 --- a/log/zerolog.go +++ /dev/null @@ -1,60 +0,0 @@ -package log - -import ( - "os" - "time" - - cmtlog "github.com/cometbft/cometbft/libs/log" - "github.com/rs/zerolog" -) - -// Defines commons keys for logging -const ModuleKey = "module" - -var ( - // ContextKey is used to store the logger in the context - ContextKey struct{} - _ Logger = (*ZeroLogWrapper)(nil) -) - -func NewZeroLogger(key, value string) *zerolog.Logger { - output := zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.Kitchen} - logger := zerolog.New(output).With().Str(key, value).Timestamp().Logger() - return &logger -} - -// TODO: add filtered logging in ZeroLog: https://github.com/cosmos/cosmos-sdk/pull/13236 / https://github.com/cosmos/cosmos-sdk/issues/13699#issuecomment-1354887644 - -// ZeroLogWrapper provides a wrapper around a zerolog.Logger instance. It implements -// Tendermint's Logger interface. -type ZeroLogWrapper struct { - zerolog.Logger -} - -// Info implements Tendermint's Logger interface and logs with level INFO. A set -// of key/value tuples may be provided to add context to the log. The number of -// tuples must be even and the key of the tuple must be a string. -func (z ZeroLogWrapper) Info(msg string, keyVals ...interface{}) { - z.Logger.Info().Fields(keyVals).Msg(msg) -} - -// Error implements Tendermint's Logger interface and logs with level ERR. A set -// of key/value tuples may be provided to add context to the log. The number of -// tuples must be even and the key of the tuple must be a string. -func (z ZeroLogWrapper) Error(msg string, keyVals ...interface{}) { - z.Logger.Error().Fields(keyVals).Msg(msg) -} - -// Debug implements Tendermint's Logger interface and logs with level DEBUG. A set -// of key/value tuples may be provided to add context to the log. The number of -// tuples must be even and the key of the tuple must be a string. -func (z ZeroLogWrapper) Debug(msg string, keyVals ...interface{}) { - z.Logger.Debug().Fields(keyVals).Msg(msg) -} - -// With returns a new wrapped logger with additional context provided by a set -// of key/value tuples. The number of tuples must be even and the key of the -// tuple must be a string. -func (z ZeroLogWrapper) With(keyVals ...interface{}) cmtlog.Logger { - return ZeroLogWrapper{z.Logger.With().Fields(keyVals).Logger()} -} diff --git a/scripts/mockgen.sh b/scripts/mockgen.sh index 8906d0a07b8..a3786acc50d 100755 --- a/scripts/mockgen.sh +++ b/scripts/mockgen.sh @@ -7,7 +7,7 @@ $mockgen_cmd -source=types/module/module.go -package mock -destination testutil/ $mockgen_cmd -source=types/module/mock_appmodule_test.go -package mock -destination testutil/mock/types_mock_appmodule.go $mockgen_cmd -source=types/invariant.go -package mock -destination testutil/mock/types_invariant.go $mockgen_cmd -package mock -destination testutil/mock/grpc_server.go github.com/cosmos/gogoproto/grpc Server -$mockgen_cmd -package mock -destination testutil/mock/cometbft_log.go github.com/cometbft/cometbft/libs/log Logger +$mockgen_cmd -package mock -destination testutil/mock/logger.go cosmossdk.io/log Logger $mockgen_cmd -source=orm/model/ormtable/hooks.go -package ormmocks -destination orm/testing/ormmocks/hooks.go $mockgen_cmd -source=x/nft/expected_keepers.go -package testutil -destination x/nft/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/feegrant/expected_keepers.go -package testutil -destination x/feegrant/testutil/expected_keepers_mocks.go diff --git a/server/api/server.go b/server/api/server.go index 4ea289fce99..267e64b5a28 100644 --- a/server/api/server.go +++ b/server/api/server.go @@ -21,6 +21,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/server/config" + logwrp "github.com/cosmos/cosmos-sdk/server/log" "github.com/cosmos/cosmos-sdk/telemetry" grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" ) @@ -148,9 +149,9 @@ func (s *Server) Start(ctx context.Context, cfg config.Config) error { if enableUnsafeCORS { allowAllCORS := handlers.CORS(handlers.AllowedHeaders([]string{"Content-Type"})) - errCh <- tmrpcserver.Serve(s.listener, allowAllCORS(s.Router), s.logger, cmtCfg) + errCh <- tmrpcserver.Serve(s.listener, allowAllCORS(s.Router), logwrp.CometZeroLogWrapper{Logger: s.logger}, cmtCfg) } else { - errCh <- tmrpcserver.Serve(s.listener, s.Router, s.logger, cmtCfg) + errCh <- tmrpcserver.Serve(s.listener, s.Router, logwrp.CometZeroLogWrapper{Logger: s.logger}, cmtCfg) } }(cfg.API.EnableUnsafeCORS) diff --git a/server/log/cmt_logger.go b/server/log/cmt_logger.go new file mode 100644 index 00000000000..2bec70900d9 --- /dev/null +++ b/server/log/cmt_logger.go @@ -0,0 +1,22 @@ +package server + +import ( + "cosmossdk.io/log" + cmtlog "github.com/cometbft/cometbft/libs/log" +) + +var _ cmtlog.Logger = (*CometZeroLogWrapper)(nil) + +// CometZeroLogWrapper provides a wrapper around a zerolog.Logger instance. +// It implements CometBFT's Logger interface. +type CometZeroLogWrapper struct { + log.Logger +} + +// With returns a new wrapped logger with additional context provided by a set +// of key/value tuples. The number of tuples must be even and the key of the +// tuple must be a string. +func (cmt CometZeroLogWrapper) With(keyVals ...interface{}) cmtlog.Logger { + logger := cmt.Logger.With(keyVals...) + return CometZeroLogWrapper{logger} +} diff --git a/server/mock/app.go b/server/mock/app.go index b1d78dcfd85..5c977b53d21 100644 --- a/server/mock/app.go +++ b/server/mock/app.go @@ -8,10 +8,10 @@ import ( "path/filepath" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" db "github.com/cosmos/cosmos-db" "google.golang.org/grpc" + "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" bam "github.com/cosmos/cosmos-sdk/baseapp" diff --git a/server/mock/helpers.go b/server/mock/helpers.go index 2d29bc494e6..42f5ad984ea 100644 --- a/server/mock/helpers.go +++ b/server/mock/helpers.go @@ -5,18 +5,18 @@ import ( "os" "testing" + "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" - cmtlog "github.com/cometbft/cometbft/libs/log" ) // SetupApp returns an application as well as a clean-up function to be used to // quickly setup a test case with an app. func SetupApp() (abci.Application, func(), error) { - var logger cmtlog.Logger + var logger log.Logger if testing.Verbose() { - logger = cmtlog.NewTMLogger(cmtlog.NewSyncWriter(os.Stdout)).With("module", "mock") + logger = log.NewLoggerWithKV("module", "mock") } else { - logger = cmtlog.NewNopLogger() + logger = log.NewNopLogger() } rootDir, err := os.MkdirTemp("", "mock-sdk") diff --git a/server/start.go b/server/start.go index 787467ae94f..5e4fb614951 100644 --- a/server/start.go +++ b/server/start.go @@ -28,6 +28,7 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servergrpc "github.com/cosmos/cosmos-sdk/server/grpc" + servercmtlog "github.com/cosmos/cosmos-sdk/server/log" "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/telemetry" "github.com/cosmos/cosmos-sdk/types/mempool" @@ -229,7 +230,7 @@ func startStandAlone(svrCtx *Context, appCreator types.AppCreator) error { return fmt.Errorf("error creating listener: %v", err) } - svr.SetLogger(svrCtx.Logger.With("module", "abci-server")) + svr.SetLogger(servercmtlog.CometZeroLogWrapper{svrCtx.Logger.With("module", "abci-server")}) ctx, cancelFn := context.WithCancel(context.Background()) g, ctx := errgroup.WithContext(ctx) @@ -324,7 +325,7 @@ func startInProcess(svrCtx *Context, clientCtx client.Context, appCreator types. genDocProvider, node.DefaultDBProvider, node.DefaultMetricsProvider(cfg.Instrumentation), - svrCtx.Logger, + servercmtlog.CometZeroLogWrapper{Logger: svrCtx.Logger}, ) if err != nil { return err diff --git a/server/util.go b/server/util.go index 4281bb54624..a96cd671ec1 100644 --- a/server/util.go +++ b/server/util.go @@ -15,22 +15,20 @@ import ( "syscall" "time" - "cosmossdk.io/log" - "cosmossdk.io/store" - "cosmossdk.io/store/snapshots" - snapshottypes "cosmossdk.io/store/snapshots/types" - storetypes "cosmossdk.io/store/types" cmtcmd "github.com/cometbft/cometbft/cmd/cometbft/commands" cmtcfg "github.com/cometbft/cometbft/config" - cmtcli "github.com/cometbft/cometbft/libs/cli" - cmtflags "github.com/cometbft/cometbft/libs/cli/flags" - cmtlog "github.com/cometbft/cometbft/libs/log" dbm "github.com/cosmos/cosmos-db" "github.com/spf13/cast" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/snapshots" + snapshottypes "cosmossdk.io/store/snapshots/types" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server/config" @@ -48,7 +46,7 @@ const ServerContextKey = sdk.ContextKey("server.context") type Context struct { Viper *viper.Viper Config *cmtcfg.Config - Logger cmtlog.Logger + Logger log.Logger } // ErrorCode contains the exit code for server exit. @@ -64,11 +62,11 @@ func NewDefaultContext() *Context { return NewContext( viper.New(), cmtcfg.DefaultConfig(), - cmtlog.NewTMLogger(cmtlog.NewSyncWriter(os.Stdout)), + log.NewLogger(), ) } -func NewContext(v *viper.Viper, config *cmtcfg.Config, logger cmtlog.Logger) *Context { +func NewContext(v *viper.Viper, config *cmtcfg.Config, logger log.Logger) *Context { return &Context{v, config, logger} } @@ -153,22 +151,23 @@ func InterceptConfigsPreRunHandler(cmd *cobra.Command, customAppConfigTemplate s return err } - var logger cmtlog.Logger + var logger log.Logger if serverCtx.Viper.GetString(flags.FlagLogFormat) == cmtcfg.LogFormatJSON { - logger = cmtlog.NewTMJSONLogger(cmtlog.NewSyncWriter(os.Stdout)) + logger = log.NewLogger() } else { - logger = cmtlog.NewTMLogger(cmtlog.NewSyncWriter(os.Stdout)) - } - logger, err = cmtflags.ParseLogLevel(config.LogLevel, logger, cmtcfg.DefaultLogLevel) - if err != nil { - return err + // logger = cmtlog.NewTMLogger(cmtlog.NewSyncWriter(os.Stdout)) + logger = log.NewLogger() } + // logger, err = cmtflags.ParseLogLevel(config.LogLevel, logger, cmtcfg.DefaultLogLevel) + // if err != nil { + // return err + // } // Check if the CometBFT flag for trace logging is set if it is then setup // a tracing logger in this app as well. - if serverCtx.Viper.GetBool(cmtcli.TraceFlag) { - logger = cmtlog.NewTracingLogger(logger) - } + // if serverCtx.Viper.GetBool(cmtcli.TraceFlag) { + // logger = cmtlog.NewTracingLogger(logger) + // } serverCtx.Logger = logger.With("module", "server") diff --git a/simapp/app_test.go b/simapp/app_test.go index 08b84e489ac..882d35e6df5 100644 --- a/simapp/app_test.go +++ b/simapp/app_test.go @@ -3,19 +3,18 @@ package simapp import ( "encoding/json" "fmt" - "os" "testing" "cosmossdk.io/x/evidence" "cosmossdk.io/x/upgrade" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/gogoproto/proto" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "cosmossdk.io/log" feegrantmodule "cosmossdk.io/x/feegrant/module" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/testutil/mock" @@ -41,7 +40,7 @@ import ( func TestSimAppExportAndBlockedAddrs(t *testing.T) { db := dbm.NewMemDB() - logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) + logger := log.NewLogger() app := NewSimappWithCustomOptions(t, false, SetupOptions{ Logger: logger, DB: db, @@ -66,7 +65,7 @@ func TestSimAppExportAndBlockedAddrs(t *testing.T) { app.Commit() - logger2 := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) + logger2 := log.NewLogger() // Making a new app object with the db, so that initchain hasn't been called app2 := NewSimApp(logger2, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir())) _, err := app2.ExportAppStateAndValidators(false, []string{}, []string{}) @@ -75,7 +74,7 @@ func TestSimAppExportAndBlockedAddrs(t *testing.T) { func TestRunMigrations(t *testing.T) { db := dbm.NewMemDB() - logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) + logger := log.NewLogger() app := NewSimApp(logger, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir())) // Create a new baseapp and configurator for the purpose of this test. @@ -209,7 +208,7 @@ func TestRunMigrations(t *testing.T) { func TestInitGenesisOnMigration(t *testing.T) { db := dbm.NewMemDB() - logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) + logger := log.NewLogger() app := NewSimApp(logger, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir())) ctx := app.NewContext(true, cmtproto.Header{Height: app.LastBlockHeight()}) @@ -252,7 +251,7 @@ func TestInitGenesisOnMigration(t *testing.T) { func TestUpgradeStateOnGenesis(t *testing.T) { db := dbm.NewMemDB() - logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) + logger := log.NewLogger() app := NewSimappWithCustomOptions(t, false, SetupOptions{ Logger: logger, DB: db, diff --git a/simapp/go.mod b/simapp/go.mod index f73132a0f7e..1764384abce 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -7,9 +7,9 @@ require ( cosmossdk.io/client/v2 v2.0.0-20230220152935-67f04e629623 cosmossdk.io/core v0.5.1 cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 + cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 - cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 + cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 cosmossdk.io/tools/confix v0.0.0-20230120150717-4f6f6c00021f cosmossdk.io/tools/rosetta v0.2.0 cosmossdk.io/x/evidence v0.1.0 diff --git a/simapp/go.sum b/simapp/go.sum index 7ae2ef9a09a..e3dd19ab2b3 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -200,12 +200,12 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 h1:Scox9JfANgkuAO0F9LMH0e0W5ijmp2BQbsok/U+jDUo= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78/go.mod h1:MyvZ6k9eL0azI/yf8m5gqsM8PgbtFmqjire1OxUMkmc= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.0 h1:53f5TIXhpPYJGMm47SUslcV2i8JNBEN3eE08BmxE/Zg= cosmossdk.io/x/tx v0.2.0/go.mod h1:CTko7wgt7aBdbxOesZ+Wo1uO/03ueKzIQ0iI323Rqgk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -842,8 +842,8 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= diff --git a/simapp/sim_test.go b/simapp/sim_test.go index e104e62a513..2a6688c25d4 100644 --- a/simapp/sim_test.go +++ b/simapp/sim_test.go @@ -11,11 +11,11 @@ import ( evidencetypes "cosmossdk.io/x/evidence/types" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" + "cosmossdk.io/log" "cosmossdk.io/store" storetypes "cosmossdk.io/store/types" @@ -339,7 +339,7 @@ func TestAppStateDeterminism(t *testing.T) { for j := 0; j < numTimesToRunPerSeed; j++ { var logger log.Logger if simcli.FlagVerboseValue { - logger = log.TestingLogger() + logger = log.NewTestingLogger() } else { logger = log.NewNopLogger() } diff --git a/simapp/simd/cmd/testnet.go b/simapp/simd/cmd/testnet.go index 2ba688b9e31..08445a550d7 100644 --- a/simapp/simd/cmd/testnet.go +++ b/simapp/simd/cmd/testnet.go @@ -496,7 +496,7 @@ func startTestnet(cmd *cobra.Command, args startArgs) error { networkConfig.SigningAlgo = args.algo networkConfig.MinGasPrices = args.minGasPrices networkConfig.NumValidators = args.numValidators - networkConfig.EnableTMLogging = args.enableLogging + networkConfig.EnableLogging = args.enableLogging networkConfig.RPCAddress = args.rpcAddress networkConfig.APIAddress = args.apiAddress networkConfig.GRPCAddress = args.grpcAddress diff --git a/simapp/simd/cmd/testnet_test.go b/simapp/simd/cmd/testnet_test.go index 4905d634ac7..d7b05f685cb 100644 --- a/simapp/simd/cmd/testnet_test.go +++ b/simapp/simd/cmd/testnet_test.go @@ -5,10 +5,10 @@ import ( "fmt" "testing" - "github.com/cometbft/cometbft/libs/log" "github.com/spf13/viper" "github.com/stretchr/testify/require" + "cosmossdk.io/log" "cosmossdk.io/simapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" diff --git a/store/go.mod b/store/go.mod index a31784523e0..3b669a7fc78 100644 --- a/store/go.mod +++ b/store/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( cosmossdk.io/errors v1.0.0-beta.7 - cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 + cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 github.com/armon/go-metrics v0.4.1 github.com/cometbft/cometbft v0.37.0-alpha.3 @@ -38,8 +38,6 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect - github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect @@ -77,3 +75,5 @@ require ( // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 replace github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1 + +replace cosmossdk.io/log => ../log diff --git a/store/go.sum b/store/go.sum index 4a8e62a7959..a1b7e3d8935 100644 --- a/store/go.sum +++ b/store/go.sum @@ -1,8 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 h1:Scox9JfANgkuAO0F9LMH0e0W5ijmp2BQbsok/U+jDUo= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78/go.mod h1:MyvZ6k9eL0azI/yf8m5gqsM8PgbtFmqjire1OxUMkmc= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= @@ -104,12 +102,8 @@ github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= -github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= diff --git a/store/iavl/store.go b/store/iavl/store.go index 5b55b526048..2bd523194f7 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -6,13 +6,13 @@ import ( "io" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" ics23 "github.com/confio/ics23/go" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/iavl" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" "cosmossdk.io/store/cachekv" "cosmossdk.io/store/internal/kv" "cosmossdk.io/store/metrics" diff --git a/store/snapshots/manager_test.go b/store/snapshots/manager_test.go index 4756a6a8d58..a3e9e35957b 100644 --- a/store/snapshots/manager_test.go +++ b/store/snapshots/manager_test.go @@ -4,10 +4,10 @@ import ( "errors" "testing" - "github.com/cometbft/cometbft/libs/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "cosmossdk.io/log" "cosmossdk.io/store/snapshots" "cosmossdk.io/store/snapshots/types" ) diff --git a/store/snapshots/store.go b/store/snapshots/store.go index 8434c9f37d8..c0db328bffe 100644 --- a/store/snapshots/store.go +++ b/store/snapshots/store.go @@ -3,6 +3,7 @@ package snapshots import ( "crypto/sha256" "encoding/binary" + "hash" "io" "math" "os" @@ -256,37 +257,27 @@ func (s *Store) Save( Height: height, Format: format, } + + dirCreated := false index := uint32(0) snapshotHasher := sha256.New() chunkHasher := sha256.New() for chunkBody := range chunks { - defer chunkBody.Close() //nolint:staticcheck - dir := s.pathSnapshot(height, format) - err = os.MkdirAll(dir, 0o755) - if err != nil { - return nil, errors.Wrapf(err, "failed to create snapshot directory %q", dir) - } - path := s.pathChunk(height, format, index) - file, err := os.Create(path) - if err != nil { - return nil, errors.Wrapf(err, "failed to create snapshot chunk file %q", path) - } - defer file.Close() //nolint:staticcheck + // Only create the snapshot directory on encountering the first chunk. + // If the directory disappears during chunk saving, + // the whole operation will fail anyway. + if !dirCreated { + dir := s.pathSnapshot(height, format) + if err := os.MkdirAll(dir, 0o755); err != nil { + return nil, errors.Wrapf(err, "failed to create snapshot directory %q", dir) + } - chunkHasher.Reset() - _, err = io.Copy(io.MultiWriter(file, chunkHasher, snapshotHasher), chunkBody) - if err != nil { - return nil, errors.Wrapf(err, "failed to generate snapshot chunk %v", index) - } - err = file.Close() - if err != nil { - return nil, errors.Wrapf(err, "failed to close snapshot chunk %v", index) + dirCreated = true } - err = chunkBody.Close() - if err != nil { - return nil, errors.Wrapf(err, "failed to close snapshot chunk %v", index) + + if err := s.saveChunk(chunkBody, index, snapshot, chunkHasher, snapshotHasher); err != nil { + return nil, err } - snapshot.Metadata.ChunkHashes = append(snapshot.Metadata.ChunkHashes, chunkHasher.Sum(nil)) index++ } snapshot.Chunks = index @@ -294,6 +285,36 @@ func (s *Store) Save( return snapshot, s.saveSnapshot(snapshot) } +// saveChunk saves the given chunkBody with the given index to its appropriate path on disk. +// The hash of the chunk is appended to the snapshot's metadata, +// and the overall snapshot hash is updated with the chunk content too. +func (s *Store) saveChunk(chunkBody io.ReadCloser, index uint32, snapshot *types.Snapshot, chunkHasher, snapshotHasher hash.Hash) error { + defer chunkBody.Close() + + path := s.pathChunk(snapshot.Height, snapshot.Format, index) + chunkFile, err := os.Create(path) + if err != nil { + return errors.Wrapf(err, "failed to create snapshot chunk file %q", path) + } + defer chunkFile.Close() + + chunkHasher.Reset() + if _, err := io.Copy(io.MultiWriter(chunkFile, chunkHasher, snapshotHasher), chunkBody); err != nil { + return errors.Wrapf(err, "failed to generate snapshot chunk %d", index) + } + + if err := chunkFile.Close(); err != nil { + return errors.Wrapf(err, "failed to close snapshot chunk file %d", index) + } + + if err := chunkBody.Close(); err != nil { + return errors.Wrapf(err, "failed to close snapshot chunk body %d", index) + } + + snapshot.Metadata.ChunkHashes = append(snapshot.Metadata.ChunkHashes, chunkHasher.Sum(nil)) + return nil +} + // saveSnapshot saves snapshot metadata to the database. func (s *Store) saveSnapshot(snapshot *types.Snapshot) error { value, err := proto.Marshal(snapshot) diff --git a/store/store.go b/store/store.go index 04f28521c60..e6745754639 100644 --- a/store/store.go +++ b/store/store.go @@ -1,9 +1,9 @@ package store import ( - "github.com/cometbft/cometbft/libs/log" dbm "github.com/cosmos/cosmos-db" + "cosmossdk.io/log" "cosmossdk.io/store/cache" "cosmossdk.io/store/metrics" "cosmossdk.io/store/rootmulti" diff --git a/store/streaming/constructor.go b/store/streaming/constructor.go index fdf22497ecf..acfe2cd2e7e 100644 --- a/store/streaming/constructor.go +++ b/store/streaming/constructor.go @@ -7,9 +7,9 @@ import ( "strings" "sync" + "cosmossdk.io/log" "cosmossdk.io/store/streaming/file" "cosmossdk.io/store/types" - "github.com/cometbft/cometbft/libs/log" "github.com/spf13/cast" ) diff --git a/store/streaming/constructor_test.go b/store/streaming/constructor_test.go index cdb6fc6db5e..aacc4f79d78 100644 --- a/store/streaming/constructor_test.go +++ b/store/streaming/constructor_test.go @@ -3,9 +3,9 @@ package streaming_test import ( "testing" - "github.com/cometbft/cometbft/libs/log" "github.com/stretchr/testify/require" + "cosmossdk.io/log" "cosmossdk.io/store/streaming" "cosmossdk.io/store/streaming/file" "cosmossdk.io/store/types" diff --git a/store/streaming/file/service_test.go b/store/streaming/file/service_test.go index ff901dc8e6c..ba71d4eda7d 100644 --- a/store/streaming/file/service_test.go +++ b/store/streaming/file/service_test.go @@ -11,10 +11,10 @@ import ( "testing" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" + "cosmossdk.io/log" "cosmossdk.io/store/types" ) diff --git a/tests/e2e/server/export_test.go b/tests/e2e/server/export_test.go index 11f2a190abc..72a75736ae2 100644 --- a/tests/e2e/server/export_test.go +++ b/tests/e2e/server/export_test.go @@ -14,7 +14,6 @@ import ( "testing" abci "github.com/cometbft/cometbft/abci/types" - cmtlog "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/spf13/cobra" @@ -158,7 +157,7 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, ge err := createConfigFolder(tempDir) assert.NilError(t, err) - logger := cmtlog.NewTMLogger(cmtlog.NewSyncWriter(os.Stdout)) + logger := log.NewLogger() db := dbm.NewMemDB() app := simapp.NewSimApp(logger, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(tempDir)) diff --git a/tests/go.mod b/tests/go.mod index fdbfb42a6b8..88fb9e18158 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -6,10 +6,10 @@ require ( cosmossdk.io/api v0.3.1 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7 - cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 + cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 cosmossdk.io/simapp v0.0.0-00010101000000-000000000000 - cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 + cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 cosmossdk.io/x/evidence v0.1.0 cosmossdk.io/x/feegrant v0.0.0-20230117113717-50e7c4a4ceff cosmossdk.io/x/nft v0.0.0-20230113085233-fae3332d62fc diff --git a/tests/go.sum b/tests/go.sum index fbd36b0d97a..2c2c4281651 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -198,12 +198,12 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 h1:Scox9JfANgkuAO0F9LMH0e0W5ijmp2BQbsok/U+jDUo= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78/go.mod h1:MyvZ6k9eL0azI/yf8m5gqsM8PgbtFmqjire1OxUMkmc= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/testutil/mock/cometbft_log.go b/testutil/mock/logger.go similarity index 96% rename from testutil/mock/cometbft_log.go rename to testutil/mock/logger.go index 437e11332a7..0bd2e723c56 100644 --- a/testutil/mock/cometbft_log.go +++ b/testutil/mock/logger.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/cometbft/cometbft/libs/log (interfaces: Logger) +// Source: cosmossdk.io/log (interfaces: Logger) // Package mock is a generated GoMock package. package mock @@ -7,7 +7,7 @@ package mock import ( reflect "reflect" - log "github.com/cometbft/cometbft/libs/log" + log "cosmossdk.io/log" gomock "github.com/golang/mock/gomock" ) diff --git a/testutil/network/network.go b/testutil/network/network.go index 347d0d317b2..72f7439307c 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -20,7 +20,6 @@ import ( sdkmath "cosmossdk.io/math" "cosmossdk.io/math/unsafe" pruningtypes "cosmossdk.io/store/pruning/types" - cmtlog "github.com/cometbft/cometbft/libs/log" "github.com/cometbft/cometbft/node" cmtclient "github.com/cometbft/cometbft/rpc/client" dbm "github.com/cosmos/cosmos-db" @@ -119,7 +118,7 @@ type Config struct { StakingTokens sdkmath.Int // the amount of tokens each validator has available to stake BondedTokens sdkmath.Int // the amount of tokens each validator stakes PruningStrategy string // the pruning strategy each validator will have - EnableTMLogging bool // enable CometBFT logging to STDOUT + EnableLogging bool // enable logging to STDOUT CleanupDir bool // remove base temporary directory during cleanup SigningAlgo string // signing algorithm for keys KeyringOptions []keyring.Option // keyring configuration options @@ -406,8 +405,8 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { } logger := log.NewNopLogger() - if cfg.EnableTMLogging { - logger = cmtlog.NewTMLogger(cmtlog.NewSyncWriter(os.Stdout)) + if cfg.EnableLogging { + logger = log.NewLogger() } ctx.Logger = logger diff --git a/testutil/network/util.go b/testutil/network/util.go index 5ca2be4e1f0..adef300d68e 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -19,6 +19,7 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" servergrpc "github.com/cosmos/cosmos-sdk/server/grpc" + logwrp "github.com/cosmos/cosmos-sdk/server/log" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/genutil" @@ -57,7 +58,7 @@ func startInProcess(cfg Config, val *Validator) error { appGenesisProvider, node.DefaultDBProvider, node.DefaultMetricsProvider(cmtCfg.Instrumentation), - logger.With("module", val.Moniker), + logwrp.CometZeroLogWrapper{Logger: logger.With("module", val.Moniker)}, ) if err != nil { return err diff --git a/testutil/sims/app_helpers.go b/testutil/sims/app_helpers.go index 7c168719b62..0dc3a91e714 100644 --- a/testutil/sims/app_helpers.go +++ b/testutil/sims/app_helpers.go @@ -9,11 +9,11 @@ import ( sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" cmtjson "github.com/cometbft/cometbft/libs/json" - "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" diff --git a/testutil/sims/simulation_helpers.go b/testutil/sims/simulation_helpers.go index 848e1c875d0..790392a5230 100644 --- a/testutil/sims/simulation_helpers.go +++ b/testutil/sims/simulation_helpers.go @@ -6,9 +6,9 @@ import ( "fmt" "os" - "github.com/cometbft/cometbft/libs/log" dbm "github.com/cosmos/cosmos-db" + "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" @@ -29,7 +29,7 @@ func SetupSimulation(config simtypes.Config, dirPrefix, dbName string, verbose, var logger log.Logger if verbose { - logger = log.TestingLogger() + logger = log.NewLogger() } else { logger = log.NewNopLogger() } diff --git a/tools/confix/go.mod b/tools/confix/go.mod index a0217e9b0f6..b62a9a251b9 100644 --- a/tools/confix/go.mod +++ b/tools/confix/go.mod @@ -18,7 +18,7 @@ require ( cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect cosmossdk.io/errors v1.0.0-beta.7 // indirect - cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 // indirect + cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f // indirect cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 // indirect cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 // indirect cosmossdk.io/x/tx v0.2.0 // indirect diff --git a/tools/confix/go.sum b/tools/confix/go.sum index 24f2feae42f..5a72f7bed97 100644 --- a/tools/confix/go.sum +++ b/tools/confix/go.sum @@ -45,8 +45,8 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 h1:Scox9JfANgkuAO0F9LMH0e0W5ijmp2BQbsok/U+jDUo= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78/go.mod h1:MyvZ6k9eL0azI/yf8m5gqsM8PgbtFmqjire1OxUMkmc= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= diff --git a/tools/cosmovisor/args.go b/tools/cosmovisor/args.go index 8291870643e..8cfb9444068 100644 --- a/tools/cosmovisor/args.go +++ b/tools/cosmovisor/args.go @@ -10,11 +10,11 @@ import ( "strings" "time" + "cosmossdk.io/log" cverrors "cosmossdk.io/tools/cosmovisor/errors" upgradekeeper "cosmossdk.io/x/upgrade/keeper" "cosmossdk.io/x/upgrade/plan" upgradetypes "cosmossdk.io/x/upgrade/types" - "github.com/rs/zerolog" ) // environment variable names @@ -209,16 +209,16 @@ func parseEnvDuration(input string) (time.Duration, error) { } // LogConfigOrError logs either the config details or the error. -func LogConfigOrError(logger *zerolog.Logger, cfg *Config, err error) { +func LogConfigOrError(logger log.Logger, cfg *Config, err error) { if cfg == nil && err == nil { return } - logger.Info().Msg("configuration:") + logger.Info("configuration:") switch { case err != nil: cverrors.LogErrors(logger, "configuration errors found", err) case cfg != nil: - logger.Info().Msg(cfg.DetailString()) + logger.Info(cfg.DetailString()) } } diff --git a/tools/cosmovisor/args_test.go b/tools/cosmovisor/args_test.go index 0f65481fdef..ffb93229454 100644 --- a/tools/cosmovisor/args_test.go +++ b/tools/cosmovisor/args_test.go @@ -14,6 +14,7 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "cosmossdk.io/log" "cosmossdk.io/tools/cosmovisor/errors" "cosmossdk.io/x/upgrade/plan" ) @@ -624,10 +625,10 @@ func (s *argsTestSuite) TestLogConfigOrError() { } errMulti := errors.FlattenErrors(errs...) - makeTestLogger := func(testName string, out io.Writer) *zerolog.Logger { + makeTestLogger := func(testName string, out io.Writer) log.Logger { output := zerolog.ConsoleWriter{Out: out, TimeFormat: time.Kitchen, NoColor: true} logger := zerolog.New(output).With().Str("test", testName).Timestamp().Logger() - return &logger + return log.NewCustomLogger(logger) } tests := []struct { diff --git a/tools/cosmovisor/cmd/cosmovisor/main.go b/tools/cosmovisor/cmd/cosmovisor/main.go index 95d51a194fb..70e14d08388 100644 --- a/tools/cosmovisor/cmd/cosmovisor/main.go +++ b/tools/cosmovisor/cmd/cosmovisor/main.go @@ -9,7 +9,7 @@ import ( ) func main() { - logger := log.NewZeroLogger(log.ModuleKey, "cosmovisor") + logger := log.NewLoggerWithKV(log.ModuleKey, "cosmovisor") ctx := context.WithValue(context.Background(), log.ContextKey, logger) if err := rootCmd.ExecuteContext(ctx); err != nil { diff --git a/tools/cosmovisor/cmd/cosmovisor/run.go b/tools/cosmovisor/cmd/cosmovisor/run.go index c4b5f592028..13e6ae15a1e 100644 --- a/tools/cosmovisor/cmd/cosmovisor/run.go +++ b/tools/cosmovisor/cmd/cosmovisor/run.go @@ -3,7 +3,6 @@ package main import ( "cosmossdk.io/log" "cosmossdk.io/tools/cosmovisor" - "github.com/rs/zerolog" "github.com/spf13/cobra" ) @@ -17,14 +16,14 @@ var runCmd = &cobra.Command{ SilenceUsage: true, DisableFlagParsing: true, RunE: func(cmd *cobra.Command, args []string) error { - logger := cmd.Context().Value(log.ContextKey).(*zerolog.Logger) + logger := cmd.Context().Value(log.ContextKey).(log.Logger) return Run(logger, args) }, } // Run runs the configured program with the given args and monitors it for upgrades. -func Run(logger *zerolog.Logger, args []string, options ...RunOption) error { +func Run(logger log.Logger, args []string, options ...RunOption) error { cfg, err := cosmovisor.GetConfigFromEnv() if err != nil { return err @@ -43,12 +42,12 @@ func Run(logger *zerolog.Logger, args []string, options ...RunOption) error { doUpgrade, err := launcher.Run(args, runCfg.StdOut, runCfg.StdErr) // if RestartAfterUpgrade, we launch after a successful upgrade (given that condition launcher.Run returns nil) for cfg.RestartAfterUpgrade && err == nil && doUpgrade { - logger.Info().Str("app", cfg.Name).Msg("upgrade detected, relaunching") + logger.Impl().Info().Str("app", cfg.Name).Msg("upgrade detected, relaunching") doUpgrade, err = launcher.Run(args, runCfg.StdOut, runCfg.StdErr) } if doUpgrade && err == nil { - logger.Info().Msg("upgrade detected, DAEMON_RESTART_AFTER_UPGRADE is off. Verify new upgrade and start cosmovisor again.") + logger.Info("upgrade detected, DAEMON_RESTART_AFTER_UPGRADE is off. Verify new upgrade and start cosmovisor again.") } return err diff --git a/tools/cosmovisor/cmd/cosmovisor/version.go b/tools/cosmovisor/cmd/cosmovisor/version.go index fba4ae3f844..40e8d7f51e0 100644 --- a/tools/cosmovisor/cmd/cosmovisor/version.go +++ b/tools/cosmovisor/cmd/cosmovisor/version.go @@ -24,7 +24,7 @@ var versionCmd = &cobra.Command{ Short: "Prints the version of Cosmovisor.", SilenceUsage: true, RunE: func(cmd *cobra.Command, args []string) error { - logger := cmd.Context().Value(log.ContextKey).(*zerolog.Logger) + logger := cmd.Context().Value(log.ContextKey).(log.Logger) if val, err := cmd.Flags().GetString(OutputFlag); val == "json" && err == nil { return printVersionJSON(logger, args) @@ -43,7 +43,7 @@ func getVersion() string { return strings.TrimSpace(version.Main.Version) } -func printVersion(logger *zerolog.Logger, args []string) error { +func printVersion(logger log.Logger, args []string) error { fmt.Printf("cosmovisor version: %s\n", getVersion()) if err := Run(logger, append([]string{"version"}, args...)); err != nil { @@ -53,12 +53,12 @@ func printVersion(logger *zerolog.Logger, args []string) error { return nil } -func printVersionJSON(logger *zerolog.Logger, args []string) error { +func printVersionJSON(logger log.Logger, args []string) error { buf := new(strings.Builder) // disable logger l := logger.Level(zerolog.Disabled) - logger = &l + logger = l if err := Run( logger, @@ -77,7 +77,7 @@ func printVersionJSON(logger *zerolog.Logger, args []string) error { }) if err != nil { l := logger.Level(zerolog.TraceLevel) - logger = &l + logger = l return fmt.Errorf("can't print version output, expected valid json from APP, got: %s - %w", buf.String(), err) } diff --git a/tools/cosmovisor/cmd/cosmovisor/version_test.go b/tools/cosmovisor/cmd/cosmovisor/version_test.go index 193ec8a1542..8f8188a2a82 100644 --- a/tools/cosmovisor/cmd/cosmovisor/version_test.go +++ b/tools/cosmovisor/cmd/cosmovisor/version_test.go @@ -10,7 +10,7 @@ import ( ) func TestVersionCommand_Error(t *testing.T) { - logger := log.NewZeroLogger(log.ModuleKey, "cosmovisor") + logger := log.NewLoggerWithKV(log.ModuleKey, "cosmovisor") rootCmd.SetArgs([]string{"version"}) diff --git a/tools/cosmovisor/errors/multi.go b/tools/cosmovisor/errors/multi.go index 297cfdf1f4d..efa3d5a9c26 100644 --- a/tools/cosmovisor/errors/multi.go +++ b/tools/cosmovisor/errors/multi.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/rs/zerolog" + "cosmossdk.io/log" ) // MultiError is an error combining multiple other errors. @@ -70,16 +70,16 @@ func (e MultiError) String() string { return e.Error() } -func LogErrors(logger *zerolog.Logger, msg string, err error) { +func LogErrors(logger log.Logger, msg string, err error) { switch err := err.(type) { case *MultiError: if msg != "" { - logger.Error().Msg(msg) + logger.Error(msg) } for i, e := range err.GetErrors() { - logger.Error().Err(e).Msg(fmt.Sprintf(" %d:", i+1)) + logger.Error(fmt.Sprintf(" %d:", i+1), "error", e) } default: - logger.Error().Err(err).Msg(msg) + logger.Error(msg, "error", err) } } diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index 33a718e3ba3..d40525e7376 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -3,8 +3,8 @@ module cosmossdk.io/tools/cosmovisor go 1.20 require ( - cosmossdk.io/log v0.0.0-20230221212541-4906caaab475 - cosmossdk.io/x/upgrade v0.0.0-20230221212541-4906caaab475 + cosmossdk.io/log v0.0.0-20230227112847-24f67e52fa98 + cosmossdk.io/x/upgrade v0.0.0-20230227110325-294ef34f396f github.com/otiai10/copy v1.9.0 github.com/rs/zerolog v1.29.0 github.com/spf13/cobra v1.6.1 @@ -23,7 +23,7 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.3 // indirect cosmossdk.io/errors v1.0.0-beta.7 // indirect cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 // indirect - cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 // indirect + cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -46,7 +46,7 @@ require ( github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0-rc.1 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f // indirect + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/gogoproto v1.4.6 // indirect diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index 4d39c3b6d95..24294f70099 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -198,15 +198,15 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v0.0.0-20230221212541-4906caaab475 h1:Z68jGEfn8iCfm4d78f0l2jbpj1yO7eKBX1kLgyFiYM0= -cosmossdk.io/log v0.0.0-20230221212541-4906caaab475/go.mod h1:nljgSl3Gz9inS+HI1TweGIcqzPbr+nRxRGVj+L2w/OY= +cosmossdk.io/log v0.0.0-20230227112847-24f67e52fa98 h1:Ajdx9YJ7yOJSUZ4kYcpS8q8c/5Lxn0x+blPM5Aqf5jk= +cosmossdk.io/log v0.0.0-20230227112847-24f67e52fa98/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.0 h1:53f5TIXhpPYJGMm47SUslcV2i8JNBEN3eE08BmxE/Zg= -cosmossdk.io/x/upgrade v0.0.0-20230221212541-4906caaab475 h1:GxRB5RceoolYxzXBPpLOUXNkdkPVGQjoa5WO5DDi3NI= -cosmossdk.io/x/upgrade v0.0.0-20230221212541-4906caaab475/go.mod h1:quZWkfAl8CWe/qW+FAy19QvTKhPLyshY+XlPGEUs1rk= +cosmossdk.io/x/upgrade v0.0.0-20230227110325-294ef34f396f h1:K9arlZkok6I5X5+FEqQBj3vtTXSccWTfOsU9WPhsif0= +cosmossdk.io/x/upgrade v0.0.0-20230227110325-294ef34f396f/go.mod h1:DgT89ckyz+u8XVfYdIoAhkFXV+o3ieva3zE+qoYu89g= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -283,8 +283,8 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= @@ -331,8 +331,8 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f h1:0dg1YgRfdt+jJeBn9NpDG2VzmxfEKJua07k3ZRPnVOk= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f/go.mod h1:98LtWwEA3hlse0sIke1NHjJh/rAlQ14bduB10UPni3c= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44 h1:f/1mkLVwoZmpT22ELVrb0YeBXJO4ZlRGGJcKs/ngaVc= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44/go.mod h1:6Ae8ntx/GVYjXesQGolH5PB5IJszNWXjACaJMfu83a4= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= diff --git a/tools/cosmovisor/process.go b/tools/cosmovisor/process.go index b7199603c14..42db794ada8 100644 --- a/tools/cosmovisor/process.go +++ b/tools/cosmovisor/process.go @@ -14,19 +14,19 @@ import ( "time" "github.com/otiai10/copy" - "github.com/rs/zerolog" + "cosmossdk.io/log" "cosmossdk.io/x/upgrade/plan" upgradetypes "cosmossdk.io/x/upgrade/types" ) type Launcher struct { - logger *zerolog.Logger + logger log.Logger cfg *Config fw *fileWatcher } -func NewLauncher(logger *zerolog.Logger, cfg *Config) (Launcher, error) { +func NewLauncher(logger log.Logger, cfg *Config) (Launcher, error) { fw, err := newUpgradeFileWatcher(logger, cfg.UpgradeInfoFilePath(), cfg.PollInterval) if err != nil { return Launcher{}, err @@ -48,7 +48,7 @@ func (l Launcher) Run(args []string, stdout, stderr io.Writer) (bool, error) { return false, fmt.Errorf("current binary is invalid: %w", err) } - l.logger.Info().Str("path", bin).Strs("args", args).Msg("running app") + l.logger.Impl().Info().Str("path", bin).Strs("args", args).Msg("running app") cmd := exec.Command(bin, args...) cmd.Stdout = stdout cmd.Stderr = stderr @@ -61,7 +61,7 @@ func (l Launcher) Run(args []string, stdout, stderr io.Writer) (bool, error) { go func() { sig := <-sigs if err := cmd.Process.Signal(sig); err != nil { - l.logger.Fatal().Err(err).Str("bin", bin).Msg("terminated") + l.logger.Impl().Fatal().Err(err).Str("bin", bin).Msg("terminated") } }() @@ -100,7 +100,7 @@ func (l Launcher) Run(args []string, stdout, stderr io.Writer) (bool, error) { func (l Launcher) WaitForUpgradeOrExit(cmd *exec.Cmd) (bool, error) { currentUpgrade, err := l.cfg.UpgradeInfo() if err != nil { - l.logger.Error().Err(err) + l.logger.Impl().Error().Err(err) } cmdDone := make(chan error) @@ -111,7 +111,7 @@ func (l Launcher) WaitForUpgradeOrExit(cmd *exec.Cmd) (bool, error) { select { case <-l.fw.MonitorUpdate(currentUpgrade): // upgrade - kill the process and restart - l.logger.Info().Msg("daemon shutting down in an attempt to restart") + l.logger.Info("daemon shutting down in an attempt to restart") _ = cmd.Process.Kill() case err := <-cmdDone: l.fw.Stop() @@ -151,7 +151,7 @@ func (l Launcher) doBackup() error { stStr := fmt.Sprintf("%d-%d-%d", st.Year(), st.Month(), st.Day()) dst := filepath.Join(l.cfg.DataBackupPath, fmt.Sprintf("data"+"-backup-%s", stStr)) - l.logger.Info().Time("backup start time", st).Msg("starting to take backup of data directory") + l.logger.Impl().Info().Time("backup start time", st).Msg("starting to take backup of data directory") // copy the $DAEMON_HOME/data to a backup dir if err = copy.Copy(filepath.Join(l.cfg.Home, "data"), dst); err != nil { @@ -160,7 +160,7 @@ func (l Launcher) doBackup() error { // backup is done, lets check endtime to calculate total time taken for backup process et := time.Now() - l.logger.Info().Str("backup saved at", dst).Time("backup completion time", et).TimeDiff("time taken to complete backup", et, st).Msg("backup completed") + l.logger.Impl().Info().Str("backup saved at", dst).Time("backup completion time", et).TimeDiff("time taken to complete backup", et, st).Msg("backup completed") } return nil @@ -181,17 +181,17 @@ func (l *Launcher) doPreUpgrade() error { switch err.(*exec.ExitError).ProcessState.ExitCode() { case 1: - l.logger.Info().Msg("pre-upgrade command does not exist. continuing the upgrade.") + l.logger.Info("pre-upgrade command does not exist. continuing the upgrade.") return nil case 30: return fmt.Errorf("pre-upgrade command failed : %w", err) case 31: - l.logger.Error().Err(err).Int("attempt", counter).Msg("pre-upgrade command failed. retrying") + l.logger.Impl().Error().Err(err).Int("attempt", counter).Msg("pre-upgrade command failed. retrying") continue } } - l.logger.Info().Msg("pre-upgrade successful. continuing the upgrade.") + l.logger.Info("pre-upgrade successful. continuing the upgrade.") return nil } } @@ -209,7 +209,7 @@ func (l *Launcher) executePreUpgradeCmd() error { return err } - l.logger.Info().Bytes("result", result).Msg("pre-upgrade result") + l.logger.Impl().Info().Bytes("result", result).Msg("pre-upgrade result") return nil } diff --git a/tools/cosmovisor/process_test.go b/tools/cosmovisor/process_test.go index b25f1828cb9..d2089e7fb5d 100644 --- a/tools/cosmovisor/process_test.go +++ b/tools/cosmovisor/process_test.go @@ -31,7 +31,7 @@ func (s *processTestSuite) TestLaunchProcess() { require := s.Require() home := copyTestData(s.T(), "validate") cfg := &cosmovisor.Config{Home: home, Name: "dummyd", PollInterval: 20, UnsafeSkipBackup: true} - logger := log.NewZeroLogger(log.ModuleKey, "cosmovisor") + logger := log.NewLoggerWithKV(log.ModuleKey, "cosmovisor") // should run the genesis binary and produce expected output stdout, stderr := NewBuffer(), NewBuffer() @@ -75,7 +75,7 @@ func (s *processTestSuite) TestLaunchProcessWithRestartDelay() { require := s.Require() home := copyTestData(s.T(), "validate") cfg := &cosmovisor.Config{Home: home, Name: "dummyd", RestartDelay: 5 * time.Second, PollInterval: 20, UnsafeSkipBackup: true} - logger := log.NewZeroLogger(log.ModuleKey, "cosmovisor") + logger := log.NewLoggerWithKV(log.ModuleKey, "cosmovisor") // should run the genesis binary and produce expected output stdout, stderr := NewBuffer(), NewBuffer() @@ -111,7 +111,7 @@ func (s *processTestSuite) TestLaunchProcessWithDownloads() { require := s.Require() home := copyTestData(s.T(), "download") cfg := &cosmovisor.Config{Home: home, Name: "autod", AllowDownloadBinaries: true, PollInterval: 100, UnsafeSkipBackup: true} - logger := log.NewZeroLogger(log.ModuleKey, "cosmovisor") + logger := log.NewLoggerWithKV(log.ModuleKey, "cosmovisor") upgradeFilename := cfg.UpgradeInfoFilePath() // should run the genesis binary and produce expected output diff --git a/tools/cosmovisor/scanner.go b/tools/cosmovisor/scanner.go index 49fab0ccb58..d616e06ab84 100644 --- a/tools/cosmovisor/scanner.go +++ b/tools/cosmovisor/scanner.go @@ -9,12 +9,12 @@ import ( "strings" "time" + "cosmossdk.io/log" upgradetypes "cosmossdk.io/x/upgrade/types" - "github.com/rs/zerolog" ) type fileWatcher struct { - logger *zerolog.Logger + logger log.Logger // full path to a watched file filename string @@ -29,7 +29,7 @@ type fileWatcher struct { initialized bool } -func newUpgradeFileWatcher(logger *zerolog.Logger, filename string, interval time.Duration) (*fileWatcher, error) { +func newUpgradeFileWatcher(logger log.Logger, filename string, interval time.Duration) (*fileWatcher, error) { if filename == "" { return nil, errors.New("filename undefined") } @@ -110,7 +110,7 @@ func (fw *fileWatcher) CheckUpdate(currentUpgrade upgradetypes.Plan) bool { info, err := parseUpgradeInfoFile(fw.filename) if err != nil { - fw.logger.Fatal().Err(err).Msg("failed to parse upgrade info file") + fw.logger.Impl().Fatal().Err(err).Msg("failed to parse upgrade info file") return false } diff --git a/tools/cosmovisor/upgrade.go b/tools/cosmovisor/upgrade.go index 501811d444f..65d49bf8212 100644 --- a/tools/cosmovisor/upgrade.go +++ b/tools/cosmovisor/upgrade.go @@ -6,15 +6,15 @@ import ( "os" "runtime" + "cosmossdk.io/log" "cosmossdk.io/x/upgrade/plan" upgradetypes "cosmossdk.io/x/upgrade/types" - "github.com/rs/zerolog" ) // UpgradeBinary will be called after the log message has been parsed and the process has terminated. // We can now make any changes to the underlying directory without interference and leave it // in a state, so we can make a proper restart -func UpgradeBinary(logger *zerolog.Logger, cfg *Config, p upgradetypes.Plan) error { +func UpgradeBinary(logger log.Logger, cfg *Config, p upgradetypes.Plan) error { // simplest case is to switch the link err := plan.EnsureBinary(cfg.UpgradeBin(p.Name)) if err == nil { @@ -54,11 +54,11 @@ func UpgradeBinary(logger *zerolog.Logger, cfg *Config, p upgradetypes.Plan) err } // If not there, then we try to download it... maybe - logger.Info().Msg("no upgrade binary found, beginning to download it") + logger.Info("no upgrade binary found, beginning to download it") if err := plan.DownloadUpgrade(cfg.UpgradeDir(p.Name), url, cfg.Name); err != nil { return fmt.Errorf("cannot download binary. %w", err) } - logger.Info().Msg("downloading binary complete") + logger.Info("downloading binary complete") // and then set the binary again if err := plan.EnsureBinary(cfg.UpgradeBin(p.Name)); err != nil { diff --git a/tools/cosmovisor/upgrade_test.go b/tools/cosmovisor/upgrade_test.go index 540f420401c..3b976a75399 100644 --- a/tools/cosmovisor/upgrade_test.go +++ b/tools/cosmovisor/upgrade_test.go @@ -94,7 +94,7 @@ func (s *upgradeTestSuite) assertCurrentLink(cfg cosmovisor.Config, target strin func (s *upgradeTestSuite) TestUpgradeBinaryNoDownloadUrl() { home := copyTestData(s.T(), "validate") cfg := &cosmovisor.Config{Home: home, Name: "dummyd", AllowDownloadBinaries: true} - logger := log.NewZeroLogger(log.ModuleKey, "cosmovisor") + logger := log.NewLoggerWithKV(log.ModuleKey, "cosmovisor") currentBin, err := cfg.CurrentBin() s.Require().NoError(err) @@ -127,7 +127,7 @@ func (s *upgradeTestSuite) TestUpgradeBinaryNoDownloadUrl() { } func (s *upgradeTestSuite) TestUpgradeBinary() { - logger := log.NewZeroLogger(log.ModuleKey, "cosmovisor") + logger := log.NewLoggerWithKV(log.ModuleKey, "cosmovisor") cases := map[string]struct { url string diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index 3bee6cb1da3..aea1117f852 100644 --- a/tools/hubl/go.mod +++ b/tools/hubl/go.mod @@ -19,7 +19,7 @@ require ( cosmossdk.io/collections v0.0.0-20230214153846-b6c6e4e99177 // indirect cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 // indirect + cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f // indirect cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 // indirect cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 // indirect filippo.io/edwards25519 v1.0.0 // indirect diff --git a/tools/hubl/go.sum b/tools/hubl/go.sum index e9784b90337..3f79d13561b 100644 --- a/tools/hubl/go.sum +++ b/tools/hubl/go.sum @@ -47,8 +47,8 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 h1:Scox9JfANgkuAO0F9LMH0e0W5ijmp2BQbsok/U+jDUo= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78/go.mod h1:MyvZ6k9eL0azI/yf8m5gqsM8PgbtFmqjire1OxUMkmc= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= diff --git a/tools/rosetta/cmd/rosetta/main.go b/tools/rosetta/cmd/rosetta/main.go index 8cd21b6d003..779f08def63 100644 --- a/tools/rosetta/cmd/rosetta/main.go +++ b/tools/rosetta/cmd/rosetta/main.go @@ -11,13 +11,13 @@ import ( func main() { var ( - logger = log.NewZeroLogger(log.ModuleKey, "rosetta") + logger = log.NewLoggerWithKV(log.ModuleKey, "rosetta") interfaceRegistry = codectypes.NewInterfaceRegistry() cdc = codec.NewProtoCodec(interfaceRegistry) ) if err := rosettaCmd.RosettaCommand(interfaceRegistry, cdc).Execute(); err != nil { - logger.Err(err).Msg("failed to run rosetta") + logger.Error("failed to run rosetta", "error", err) os.Exit(1) } } diff --git a/tools/rosetta/go.mod b/tools/rosetta/go.mod index d863f1144cd..ab91f853a42 100644 --- a/tools/rosetta/go.mod +++ b/tools/rosetta/go.mod @@ -3,14 +3,13 @@ module cosmossdk.io/tools/rosetta go 1.19 require ( - cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 + cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 github.com/coinbase/rosetta-sdk-go/types v1.0.0 github.com/cometbft/cometbft v0.37.0-alpha.3 github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f github.com/cosmos/rosetta-sdk-go v0.10.0 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 - github.com/rs/zerolog v1.29.0 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.1 @@ -109,6 +108,7 @@ require ( github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/rs/cors v1.8.3 // indirect + github.com/rs/zerolog v1.29.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect diff --git a/tools/rosetta/go.sum b/tools/rosetta/go.sum index 6dfdbf8586f..b57ffb9b92d 100644 --- a/tools/rosetta/go.sum +++ b/tools/rosetta/go.sum @@ -45,8 +45,8 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 h1:Scox9JfANgkuAO0F9LMH0e0W5ijmp2BQbsok/U+jDUo= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78/go.mod h1:MyvZ6k9eL0azI/yf8m5gqsM8PgbtFmqjire1OxUMkmc= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= diff --git a/tools/rosetta/lib/internal/service/online.go b/tools/rosetta/lib/internal/service/online.go index 3f8296bb30f..213ebe2747b 100644 --- a/tools/rosetta/lib/internal/service/online.go +++ b/tools/rosetta/lib/internal/service/online.go @@ -5,8 +5,8 @@ import ( "time" "github.com/coinbase/rosetta-sdk-go/types" - "github.com/rs/zerolog" + "cosmossdk.io/log" crgerrs "cosmossdk.io/tools/rosetta/lib/errors" crgtypes "cosmossdk.io/tools/rosetta/lib/types" ) @@ -18,14 +18,14 @@ const ( // NewOnlineNetwork builds a single network adapter. // It will get the Genesis block on the beginning to avoid calling it everytime. -func NewOnlineNetwork(network *types.NetworkIdentifier, client crgtypes.Client, logger *zerolog.Logger) (crgtypes.API, error) { +func NewOnlineNetwork(network *types.NetworkIdentifier, client crgtypes.Client, logger log.Logger) (crgtypes.API, error) { ctx, cancel := context.WithTimeout(context.Background(), genesisBlockFetchTimeout) defer cancel() var genesisHeight int64 = 1 // to get genesis block height genesisBlock, err := client.BlockByHeight(ctx, &genesisHeight) if err != nil { - logger.Err(err).Msg("failed to get genesis block height") + logger.Error("failed to get genesis block height", "err", err) } return OnlineNetwork{ diff --git a/tools/rosetta/lib/server/server.go b/tools/rosetta/lib/server/server.go index 9e0aaf1633b..6e637b95d8a 100644 --- a/tools/rosetta/lib/server/server.go +++ b/tools/rosetta/lib/server/server.go @@ -8,7 +8,6 @@ import ( "github.com/coinbase/rosetta-sdk-go/types" assert "github.com/cosmos/rosetta-sdk-go/asserter" "github.com/cosmos/rosetta-sdk-go/server" - "github.com/rs/zerolog" "cosmossdk.io/log" "cosmossdk.io/tools/rosetta/lib/internal/service" @@ -40,11 +39,11 @@ type Settings struct { type Server struct { h http.Handler addr string - logger *zerolog.Logger + logger log.Logger } func (h Server) Start() error { - h.logger.Info().Msg(fmt.Sprintf("Rosetta server listening on add %s", h.addr)) + h.logger.Info(fmt.Sprintf("Rosetta server listening on add %s", h.addr)) return http.ListenAndServe(h.addr, h.h) //nolint:gosec } @@ -61,7 +60,7 @@ func NewServer(settings Settings) (Server, error) { return Server{}, fmt.Errorf("cannot build asserter: %w", err) } - logger := log.NewZeroLogger(log.ModuleKey, "rosetta") + logger := log.NewLoggerWithKV(log.ModuleKey, "rosetta") var adapter crgtypes.API switch settings.Offline { @@ -95,7 +94,7 @@ func newOfflineAdapter(settings Settings) (crgtypes.API, error) { return service.NewOffline(settings.Network, settings.Client) } -func newOnlineAdapter(settings Settings, logger *zerolog.Logger) (crgtypes.API, error) { +func newOnlineAdapter(settings Settings, logger log.Logger) (crgtypes.API, error) { if settings.Client == nil { return nil, fmt.Errorf("client is nil") } @@ -115,7 +114,7 @@ func newOnlineAdapter(settings Settings, logger *zerolog.Logger) (crgtypes.API, for i := 0; i < settings.Retries; i++ { err = settings.Client.Ready() if err != nil { - logger.Err(err).Msg("[Rosetta]- Client is not ready. Retrying ...") + logger.Error("[Rosetta]- Client is not ready. Retrying ...", "error", err) time.Sleep(settings.RetryWait) continue } diff --git a/types/mempool/mempool_test.go b/types/mempool/mempool_test.go index 744ff066df3..2d544192b87 100644 --- a/types/mempool/mempool_test.go +++ b/types/mempool/mempool_test.go @@ -5,11 +5,11 @@ import ( "math/rand" "testing" - "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "cosmossdk.io/log" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/mempool" diff --git a/types/mempool/priority_nonce_test.go b/types/mempool/priority_nonce_test.go index 88910c36c0b..6c00bf58ede 100644 --- a/types/mempool/priority_nonce_test.go +++ b/types/mempool/priority_nonce_test.go @@ -7,10 +7,10 @@ import ( "testing" "time" - "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" + "cosmossdk.io/log" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/mempool" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/types/mempool/sender_nonce_test.go b/types/mempool/sender_nonce_test.go index 69a21a10a6c..bcaca96529b 100644 --- a/types/mempool/sender_nonce_test.go +++ b/types/mempool/sender_nonce_test.go @@ -5,10 +5,10 @@ import ( "math/rand" "testing" - "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" + "cosmossdk.io/log" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/mempool" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/types/module/module_test.go b/types/module/module_test.go index e77e21fa207..055810c7edd 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -8,8 +8,8 @@ import ( "testing" "cosmossdk.io/core/appmodule" + "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/golang/mock/gomock" "github.com/spf13/cobra" diff --git a/x/auth/migrations/legacytx/stdtx_test.go b/x/auth/migrations/legacytx/stdtx_test.go index 626bc6f1ac4..f8fb9ee99b2 100644 --- a/x/auth/migrations/legacytx/stdtx_test.go +++ b/x/auth/migrations/legacytx/stdtx_test.go @@ -4,12 +4,11 @@ import ( "fmt" "testing" - "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" errorsmod "cosmossdk.io/errors" - + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" diff --git a/x/authz/keeper/keeper_test.go b/x/authz/keeper/keeper_test.go index 13768dc0d17..226b4c67a82 100644 --- a/x/authz/keeper/keeper_test.go +++ b/x/authz/keeper/keeper_test.go @@ -9,8 +9,8 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" - "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/testutil" diff --git a/x/circuit/go.mod b/x/circuit/go.mod index e0355d317a8..1520d413291 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -3,8 +3,8 @@ module github.com/cosmos/cosmos-sdk/x/circuit go 1.19 require ( - cosmossdk.io/store v0.0.0-20230220120340-067ee92d4d1f - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f + cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44 github.com/cosmos/gogoproto v1.4.6 github.com/regen-network/gocuke v0.6.2 google.golang.org/grpc v1.53.0 @@ -17,7 +17,7 @@ require ( cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect cosmossdk.io/errors v1.0.0-beta.7 // indirect - cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 // indirect + cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f // indirect cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/alecthomas/participle/v2 v2.0.0-alpha7 // indirect diff --git a/x/circuit/go.sum b/x/circuit/go.sum index 73c32dd2fe7..56f27d63c0f 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -45,15 +45,15 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 h1:Scox9JfANgkuAO0F9LMH0e0W5ijmp2BQbsok/U+jDUo= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78/go.mod h1:MyvZ6k9eL0azI/yf8m5gqsM8PgbtFmqjire1OxUMkmc= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= -cosmossdk.io/store v0.0.0-20230220120340-067ee92d4d1f h1:35sAQtwPdzvQhTGz6SwGQO0LPcJjkJWcbc2Olpnpprc= -cosmossdk.io/store v0.0.0-20230220120340-067ee92d4d1f/go.mod h1:MrrSzGa9eNZAHePmW4h5pPdnsmtQQCgJEztq9hVUKFI= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.0 h1:53f5TIXhpPYJGMm47SUslcV2i8JNBEN3eE08BmxE/Zg= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= +filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= @@ -134,8 +134,8 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f h1:0dg1YgRfdt+jJeBn9NpDG2VzmxfEKJua07k3ZRPnVOk= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f/go.mod h1:98LtWwEA3hlse0sIke1NHjJh/rAlQ14bduB10UPni3c= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44 h1:f/1mkLVwoZmpT22ELVrb0YeBXJO4ZlRGGJcKs/ngaVc= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44/go.mod h1:6Ae8ntx/GVYjXesQGolH5PB5IJszNWXjACaJMfu83a4= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogoproto v1.4.6 h1:Ee7z15dWJaGlgM2rWrK8N2IX7PQcuccu8oG68jp5RL4= @@ -326,7 +326,7 @@ github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuW github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= +github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= diff --git a/x/evidence/go.mod b/x/evidence/go.mod index b5e02cd04e2..4a8dd15db14 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -7,12 +7,12 @@ require ( cosmossdk.io/core v0.5.1 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7 - cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 + cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 - cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 + cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 github.com/cometbft/cometbft v0.37.0-alpha.3 github.com/cosmos/cosmos-proto v1.0.0-beta.2 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44 github.com/cosmos/gogoproto v1.4.6 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.2 @@ -139,6 +139,7 @@ require ( golang.org/x/crypto v0.6.0 // indirect golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb // indirect golang.org/x/net v0.7.0 // indirect + golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/term v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect diff --git a/x/evidence/go.sum b/x/evidence/go.sum index 8e21e1ab2d1..afea7822118 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -45,12 +45,12 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 h1:Scox9JfANgkuAO0F9LMH0e0W5ijmp2BQbsok/U+jDUo= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78/go.mod h1:MyvZ6k9eL0azI/yf8m5gqsM8PgbtFmqjire1OxUMkmc= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.0 h1:53f5TIXhpPYJGMm47SUslcV2i8JNBEN3eE08BmxE/Zg= cosmossdk.io/x/tx v0.2.0/go.mod h1:CTko7wgt7aBdbxOesZ+Wo1uO/03ueKzIQ0iI323Rqgk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -129,8 +129,8 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= @@ -179,8 +179,8 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f h1:0dg1YgRfdt+jJeBn9NpDG2VzmxfEKJua07k3ZRPnVOk= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f/go.mod h1:98LtWwEA3hlse0sIke1NHjJh/rAlQ14bduB10UPni3c= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44 h1:f/1mkLVwoZmpT22ELVrb0YeBXJO4ZlRGGJcKs/ngaVc= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44/go.mod h1:6Ae8ntx/GVYjXesQGolH5PB5IJszNWXjACaJMfu83a4= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -991,6 +991,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index de4c6446e7c..4b6e0179ab1 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -7,12 +7,12 @@ require ( cosmossdk.io/core v0.5.1 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7 - cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 + cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 - cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 + cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 github.com/cometbft/cometbft v0.37.0-alpha.3 github.com/cosmos/cosmos-proto v1.0.0-beta.2 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44 github.com/cosmos/gogoproto v1.4.6 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.2 @@ -141,6 +141,7 @@ require ( golang.org/x/crypto v0.6.0 // indirect golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb // indirect golang.org/x/net v0.7.0 // indirect + golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/term v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index c3fb6f531eb..b0b3ac71658 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -45,12 +45,12 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 h1:Scox9JfANgkuAO0F9LMH0e0W5ijmp2BQbsok/U+jDUo= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78/go.mod h1:MyvZ6k9eL0azI/yf8m5gqsM8PgbtFmqjire1OxUMkmc= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.0 h1:53f5TIXhpPYJGMm47SUslcV2i8JNBEN3eE08BmxE/Zg= cosmossdk.io/x/tx v0.2.0/go.mod h1:CTko7wgt7aBdbxOesZ+Wo1uO/03ueKzIQ0iI323Rqgk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -184,8 +184,8 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f h1:0dg1YgRfdt+jJeBn9NpDG2VzmxfEKJua07k3ZRPnVOk= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f/go.mod h1:98LtWwEA3hlse0sIke1NHjJh/rAlQ14bduB10UPni3c= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44 h1:f/1mkLVwoZmpT22ELVrb0YeBXJO4ZlRGGJcKs/ngaVc= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44/go.mod h1:6Ae8ntx/GVYjXesQGolH5PB5IJszNWXjACaJMfu83a4= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -997,6 +997,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/genutil/client/cli/genaccount_test.go b/x/genutil/client/cli/genaccount_test.go index 13e83647de5..3de35946d7e 100644 --- a/x/genutil/client/cli/genaccount_test.go +++ b/x/genutil/client/cli/genaccount_test.go @@ -5,10 +5,10 @@ import ( "fmt" "testing" - "github.com/cometbft/cometbft/libs/log" "github.com/spf13/viper" "github.com/stretchr/testify/require" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/hd" diff --git a/x/genutil/client/cli/init_test.go b/x/genutil/client/cli/init_test.go index ae935d887ab..01cbc5f9766 100644 --- a/x/genutil/client/cli/init_test.go +++ b/x/genutil/client/cli/init_test.go @@ -11,16 +11,17 @@ import ( abci_server "github.com/cometbft/cometbft/abci/server" "github.com/cometbft/cometbft/libs/cli" - "github.com/cometbft/cometbft/libs/log" "github.com/spf13/viper" "github.com/stretchr/testify/require" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/server" + servercmtlog "github.com/cosmos/cosmos-sdk/server/log" "github.com/cosmos/cosmos-sdk/server/mock" "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/network" @@ -218,7 +219,7 @@ func TestStartStandAlone(t *testing.T) { svr, err := abci_server.NewServer(svrAddr, "socket", app) require.NoError(t, err, "error creating listener") - svr.SetLogger(logger.With("module", "abci-server")) + svr.SetLogger(servercmtlog.CometZeroLogWrapper{Logger: logger.With("module", "abci-server")}) err = svr.Start() require.NoError(t, err) diff --git a/x/genutil/client/testutil/helpers.go b/x/genutil/client/testutil/helpers.go index 489404ae155..c570b9a6d08 100644 --- a/x/genutil/client/testutil/helpers.go +++ b/x/genutil/client/testutil/helpers.go @@ -6,9 +6,10 @@ import ( cmtcfg "github.com/cometbft/cometbft/config" "github.com/cometbft/cometbft/libs/cli" - "github.com/cometbft/cometbft/libs/log" "github.com/spf13/viper" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/server" diff --git a/x/group/keeper/genesis_test.go b/x/group/keeper/genesis_test.go index 93f2667c9c7..33a59cb5231 100644 --- a/x/group/keeper/genesis_test.go +++ b/x/group/keeper/genesis_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" - "github.com/cometbft/cometbft/libs/log" "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/baseapp" diff --git a/x/group/keeper/grpc_query_test.go b/x/group/keeper/grpc_query_test.go index ff21f01cd7c..a5716575151 100644 --- a/x/group/keeper/grpc_query_test.go +++ b/x/group/keeper/grpc_query_test.go @@ -4,10 +4,10 @@ import ( "context" "testing" - "github.com/cometbft/cometbft/libs/log" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/baseapp" diff --git a/x/group/keeper/keeper.go b/x/group/keeper/keeper.go index 22a871f3dea..73df21e9372 100644 --- a/x/group/keeper/keeper.go +++ b/x/group/keeper/keeper.go @@ -4,8 +4,7 @@ import ( "fmt" "time" - "github.com/cometbft/cometbft/libs/log" - + "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" errorsmod "cosmossdk.io/errors" diff --git a/x/group/keeper/keeper_test.go b/x/group/keeper/keeper_test.go index 66b023dfae8..35e160c0c9b 100644 --- a/x/group/keeper/keeper_test.go +++ b/x/group/keeper/keeper_test.go @@ -10,11 +10,11 @@ import ( "testing" "time" - "github.com/cometbft/cometbft/libs/log" cmttime "github.com/cometbft/cometbft/types/time" "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/baseapp" diff --git a/x/nft/go.mod b/x/nft/go.mod index d347a9ee492..4b8ef8d6e1c 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -8,10 +8,10 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 - cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 + cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 github.com/cometbft/cometbft v0.37.0-alpha.3 github.com/cosmos/cosmos-proto v1.0.0-beta.2 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44 github.com/cosmos/gogoproto v1.4.6 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.2 @@ -24,7 +24,7 @@ require ( require ( cosmossdk.io/collections v0.0.0-20230214153846-b6c6e4e99177 // indirect - cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 // indirect + cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f // indirect cosmossdk.io/x/tx v0.2.0 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -138,6 +138,7 @@ require ( golang.org/x/crypto v0.6.0 // indirect golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb // indirect golang.org/x/net v0.7.0 // indirect + golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/term v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect diff --git a/x/nft/go.sum b/x/nft/go.sum index 8e21e1ab2d1..afea7822118 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -45,12 +45,12 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 h1:Scox9JfANgkuAO0F9LMH0e0W5ijmp2BQbsok/U+jDUo= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78/go.mod h1:MyvZ6k9eL0azI/yf8m5gqsM8PgbtFmqjire1OxUMkmc= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.0 h1:53f5TIXhpPYJGMm47SUslcV2i8JNBEN3eE08BmxE/Zg= cosmossdk.io/x/tx v0.2.0/go.mod h1:CTko7wgt7aBdbxOesZ+Wo1uO/03ueKzIQ0iI323Rqgk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -129,8 +129,8 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= @@ -179,8 +179,8 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f h1:0dg1YgRfdt+jJeBn9NpDG2VzmxfEKJua07k3ZRPnVOk= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f/go.mod h1:98LtWwEA3hlse0sIke1NHjJh/rAlQ14bduB10UPni3c= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44 h1:f/1mkLVwoZmpT22ELVrb0YeBXJO4ZlRGGJcKs/ngaVc= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44/go.mod h1:6Ae8ntx/GVYjXesQGolH5PB5IJszNWXjACaJMfu83a4= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -991,6 +991,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/upgrade/abci_test.go b/x/upgrade/abci_test.go index dcaedcf37d9..aee58f0202e 100644 --- a/x/upgrade/abci_test.go +++ b/x/upgrade/abci_test.go @@ -11,11 +11,11 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/upgrade" "cosmossdk.io/x/upgrade/keeper" "cosmossdk.io/x/upgrade/types" - "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/testutil" diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 990d77ed012..0185eb0ff93 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -7,11 +7,12 @@ require ( cosmossdk.io/core v0.5.1 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7 - cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 + cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f + cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 github.com/cometbft/cometbft v0.37.0-alpha.3 github.com/cosmos/cosmos-db v1.0.0-rc.1 github.com/cosmos/cosmos-proto v1.0.0-beta.2 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44 github.com/cosmos/gogoproto v1.4.6 github.com/golang/protobuf v1.5.2 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -32,7 +33,6 @@ require ( cloud.google.com/go/iam v0.11.0 // indirect cloud.google.com/go/storage v1.29.0 // indirect cosmossdk.io/collections v0.0.0-20230214153846-b6c6e4e99177 // indirect - cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 // indirect cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 // indirect cosmossdk.io/x/tx v0.2.0 // indirect filippo.io/edwards25519 v1.0.0 // indirect @@ -162,6 +162,7 @@ require ( golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb // indirect golang.org/x/net v0.7.0 // indirect golang.org/x/oauth2 v0.5.0 // indirect + golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/term v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index ac88320e9f6..2e487ebd838 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -198,12 +198,12 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78 h1:Scox9JfANgkuAO0F9LMH0e0W5ijmp2BQbsok/U+jDUo= -cosmossdk.io/log v0.0.0-20230219145338-9553bf1eec78/go.mod h1:MyvZ6k9eL0azI/yf8m5gqsM8PgbtFmqjire1OxUMkmc= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= +cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA= cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7 h1:IwyDN/YaQmF+Pmuv8d7vRWMM/k2RjSmPBycMcmd3ICE= -cosmossdk.io/store v0.0.0-20230206092147-e03195e4b8a7/go.mod h1:1XOtuYs7jsfQkn7G3VQXB6I+2tHXKHZw2U/AafNbnlk= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= +cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.0 h1:53f5TIXhpPYJGMm47SUslcV2i8JNBEN3eE08BmxE/Zg= cosmossdk.io/x/tx v0.2.0/go.mod h1:CTko7wgt7aBdbxOesZ+Wo1uO/03ueKzIQ0iI323Rqgk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -344,8 +344,8 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f h1:0dg1YgRfdt+jJeBn9NpDG2VzmxfEKJua07k3ZRPnVOk= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f/go.mod h1:98LtWwEA3hlse0sIke1NHjJh/rAlQ14bduB10UPni3c= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44 h1:f/1mkLVwoZmpT22ELVrb0YeBXJO4ZlRGGJcKs/ngaVc= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227103508-bbe7f8a11b44/go.mod h1:6Ae8ntx/GVYjXesQGolH5PB5IJszNWXjACaJMfu83a4= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -1250,6 +1250,7 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/upgrade/keeper/keeper.go b/x/upgrade/keeper/keeper.go index ed3ccf1ccb2..f4ac2d612c0 100644 --- a/x/upgrade/keeper/keeper.go +++ b/x/upgrade/keeper/keeper.go @@ -9,9 +9,8 @@ import ( "path/filepath" "sort" - "github.com/cometbft/cometbft/libs/log" - errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" "cosmossdk.io/store/prefix" storetypes "cosmossdk.io/store/types" xp "cosmossdk.io/x/upgrade/exported" diff --git a/x/upgrade/keeper/keeper_test.go b/x/upgrade/keeper/keeper_test.go index 9eabd0920d9..eed7f80ab3e 100644 --- a/x/upgrade/keeper/keeper_test.go +++ b/x/upgrade/keeper/keeper_test.go @@ -5,10 +5,10 @@ import ( "testing" "time" - "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/suite" + "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/upgrade" "cosmossdk.io/x/upgrade/keeper" diff --git a/x/upgrade/types/plan_test.go b/x/upgrade/types/plan_test.go index 1801db97a81..4ef19b1ff0d 100644 --- a/x/upgrade/types/plan_test.go +++ b/x/upgrade/types/plan_test.go @@ -4,11 +4,11 @@ import ( "testing" "time" - "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "cosmossdk.io/log" "cosmossdk.io/x/upgrade/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types" diff --git a/x/upgrade/types/storeloader_test.go b/x/upgrade/types/storeloader_test.go index 9c7ef2e303e..16c27bd3c42 100644 --- a/x/upgrade/types/storeloader_test.go +++ b/x/upgrade/types/storeloader_test.go @@ -7,11 +7,11 @@ import ( "testing" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" + "cosmossdk.io/log" "cosmossdk.io/store/metrics" pruningtypes "cosmossdk.io/store/pruning/types" "cosmossdk.io/store/rootmulti" @@ -27,7 +27,7 @@ func useUpgradeLoader(height int64, upgrades *storetypes.StoreUpgrades) func(*ba } func defaultLogger() log.Logger { - return log.NewTMLogger(log.NewSyncWriter(os.Stdout)) + return log.NewLogger() } func initStore(t *testing.T, db dbm.DB, storeKey string, k, v []byte) {