From a018f11021f5d875135fc250de85d13bab491368 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 12:30:07 +0100 Subject: [PATCH 01/17] feat: improve logger --- baseapp/grpcrouter_test.go | 5 +- baseapp/msg_service_router_test.go | 7 +- baseapp/utils_test.go | 5 +- client/pruning/main.go | 5 +- client/v2/go.mod | 2 +- client/v2/go.sum | 4 +- go.mod | 4 +- go.sum | 10 +-- log/README.md | 2 +- log/bench_test.go | 56 +++++++----- log/go.mod | 8 +- log/go.sum | 11 --- log/logger.go | 89 +++++++++++++++++-- log/noop_logger.go | 19 ---- log/testing.go | 20 +++++ log/zerolog.go | 60 ------------- scripts/mockgen.sh | 2 +- server/api/server.go | 5 +- server/log/cmt_logger.go | 22 +++++ server/mock/app.go | 2 +- server/mock/helpers.go | 8 +- server/start.go | 5 +- server/util.go | 41 +++++---- simapp/app_test.go | 13 ++- simapp/go.mod | 4 +- simapp/go.sum | 10 +-- simapp/sim_test.go | 4 +- simapp/simd/cmd/testnet.go | 2 +- simapp/simd/cmd/testnet_test.go | 2 +- store/go.mod | 6 +- store/go.sum | 6 -- store/iavl/store.go | 2 +- store/snapshots/manager_test.go | 2 +- store/snapshots/store.go | 69 +++++++++----- store/store.go | 2 +- store/streaming/constructor.go | 2 +- store/streaming/constructor_test.go | 2 +- store/streaming/file/service_test.go | 2 +- tests/e2e/server/export_test.go | 3 +- tests/go.mod | 4 +- tests/go.sum | 8 +- testutil/mock/{cometbft_log.go => logger.go} | 4 +- testutil/network/network.go | 7 +- testutil/network/util.go | 3 +- testutil/sims/app_helpers.go | 2 +- testutil/sims/simulation_helpers.go | 4 +- tools/confix/go.mod | 2 +- tools/confix/go.sum | 4 +- tools/cosmovisor/args.go | 8 +- tools/cosmovisor/args_test.go | 5 +- tools/cosmovisor/cmd/cosmovisor/main.go | 2 +- tools/cosmovisor/cmd/cosmovisor/run.go | 9 +- tools/cosmovisor/cmd/cosmovisor/version.go | 10 +-- .../cosmovisor/cmd/cosmovisor/version_test.go | 2 +- tools/cosmovisor/errors/multi.go | 10 +-- tools/cosmovisor/go.mod | 8 +- tools/cosmovisor/go.sum | 18 ++-- tools/cosmovisor/process.go | 26 +++--- tools/cosmovisor/process_test.go | 6 +- tools/cosmovisor/scanner.go | 8 +- tools/cosmovisor/upgrade.go | 8 +- tools/cosmovisor/upgrade_test.go | 4 +- tools/hubl/go.mod | 2 +- tools/hubl/go.sum | 4 +- tools/rosetta/cmd/rosetta/main.go | 4 +- tools/rosetta/go.mod | 4 +- tools/rosetta/go.sum | 4 +- tools/rosetta/lib/internal/service/online.go | 6 +- tools/rosetta/lib/server/server.go | 11 ++- types/mempool/mempool_test.go | 2 +- types/mempool/priority_nonce_test.go | 2 +- types/mempool/sender_nonce_test.go | 2 +- types/module/module_test.go | 2 +- x/auth/migrations/legacytx/stdtx_test.go | 3 +- x/authz/keeper/keeper_test.go | 2 +- x/circuit/go.mod | 6 +- x/circuit/go.sum | 16 ++-- x/evidence/go.mod | 7 +- x/evidence/go.sum | 15 ++-- x/feegrant/go.mod | 7 +- x/feegrant/go.sum | 13 +-- x/genutil/client/cli/genaccount_test.go | 2 +- x/genutil/client/cli/init_test.go | 5 +- x/genutil/client/testutil/helpers.go | 3 +- x/group/keeper/genesis_test.go | 2 +- x/group/keeper/grpc_query_test.go | 2 +- x/group/keeper/keeper.go | 3 +- x/group/keeper/keeper_test.go | 2 +- x/nft/go.mod | 7 +- x/nft/go.sum | 15 ++-- x/upgrade/abci_test.go | 2 +- x/upgrade/go.mod | 7 +- x/upgrade/go.sum | 13 +-- x/upgrade/keeper/keeper.go | 3 +- x/upgrade/keeper/keeper_test.go | 2 +- x/upgrade/types/plan_test.go | 2 +- x/upgrade/types/storeloader_test.go | 4 +- 97 files changed, 463 insertions(+), 408 deletions(-) delete mode 100644 log/noop_logger.go create mode 100644 log/testing.go delete mode 100644 log/zerolog.go create mode 100644 server/log/cmt_logger.go rename testutil/mock/{cometbft_log.go => logger.go} (96%) diff --git a/baseapp/grpcrouter_test.go b/baseapp/grpcrouter_test.go index 860e7bbe75c1..dede24b7bc1a 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 45e4832b1a1b..c361af9d667e 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 53eb3cfaab31..1ad067c7bcf6 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 0a3d6f0e8a6d..ec996ef5dd08 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 aca5b91298f3..2356e793dff2 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 706528bcfca2..9a1b9dec8d55 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 fe27932eb503..25c02235d0ab 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 853c6179a51d..f8f944fe9569 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 e019c03bea45..c06f26e933b4 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 ed3fa9303fcd..5e6beb8b430c 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 fa553c0fc7d1..e98e6470b174 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 3c6c29508e32..f2a3d868ecd4 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 812d1e8fa205..aebef5c2f810 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 a1ffb0a8334a..000000000000 --- 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 000000000000..adeb7a649883 --- /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 d3d60105d55e..000000000000 --- 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 8906d0a07b89..a3786acc50d2 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 4ea289fce99a..267e64b5a28c 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 000000000000..2bec70900d92 --- /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 b1d78dcfd857..5c977b53d21f 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 2d29bc494e67..42f5ad984ea1 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 787467ae94f8..5e4fb614951d 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 4281bb54624a..a96cd671ec14 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 08b84e489acd..882d35e6df5d 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 f73132a0f7e8..1764384abcea 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 7ae2ef9a09a7..e3dd19ab2b36 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 e104e62a513a..2a6688c25d47 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 2ba688b9e313..08445a550d77 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 4905d634ac7e..d7b05f685cbc 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 a31784523e08..3b669a7fc785 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 4a8e62a79593..a1b7e3d89359 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 5b55b5260482..2bd523194f7f 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 4756a6a8d583..a3e9e35957b3 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 8434c9f37d80..c0db328bffec 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 04f28521c60e..e6745754639f 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 fdf22497ecf5..acfe2cd2e7e0 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 cdb6fc6db5eb..aacc4f79d78c 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 ff901dc8e6c8..ba71d4eda7d3 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 11f2a190abca..72a75736ae29 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 fdbfb42a6b8b..88fb9e181589 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 fbd36b0d97a5..2c2c42816514 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 437e11332a7c..0bd2e723c568 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 347d0d317b20..72f7439307cc 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 5ca2be4e1f03..adef300d68eb 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 7c168719b62c..0dc3a91e714c 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 848e1c875d0c..790392a5230f 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 a0217e9b0f60..b62a9a251b96 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 24f2feae42f0..5a72f7bed97a 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 8291870643e8..8cfb9444068d 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 0f65481fdef6..ffb932294546 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 95d51a194fb2..70e14d083883 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 c4b5f592028a..13e6ae15a1e4 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 fba4ae3f844a..40e8d7f51e03 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 193ec8a15423..8f8188a2a82d 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 297cfdf1f4d8..efa3d5a9c269 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 33a718e3ba39..d40525e7376f 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 4d39c3b6d956..24294f70099c 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 b7199603c149..42db794ada8d 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 b25f1828cb9d..d2089e7fb5d8 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 49fab0ccb586..d616e06ab848 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 501811d444f6..65d49bf82126 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 540f420401cb..3b976a753997 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 3bee6cb1da31..aea1117f8525 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 e9784b903373..3f79d13561b2 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 8cd21b6d0036..779f08def639 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 d863f1144cdf..ab91f853a425 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 6dfdbf8586f3..b57ffb9b92df 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 3f8296bb30f6..213ebe2747bb 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 9e0aaf1633bc..6e637b95d8a2 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 744ff066df3d..2d544192b87c 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 88910c36c0b1..6c00bf58ede0 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 69a21a10a6c4..bcaca96529b6 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 e77e21fa2071..055810c7edd5 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 626bc6f1ac46..f8fb9ee99b2c 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 13768dc0d172..226b4c67a82e 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 e0355d317a83..1520d4132913 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 73c32dd2fe72..56f27d63c0ff 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 b5e02cd04e29..4a8dd15db146 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 8e21e1ab2d13..afea78221184 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 de4c6446e7c4..4b6e0179ab1b 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 c3fb6f531eb4..b0b3ac716586 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 13e83647de5b..3de35946d7e6 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 ae935d887aba..01cbc5f97669 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 489404ae155f..c570b9a6d080 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 93f2667c9c73..33a59cb52312 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 ff21f01cd7c7..a57165751511 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 22a871f3dea3..73df21e9372f 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 66b023dfae80..35e160c0c9bf 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 d347a9ee4923..4b8ef8d6e1c6 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 8e21e1ab2d13..afea78221184 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 dcaedcf37d98..aee58f0202e2 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 990d77ed012b..0185eb0ff935 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 ac88320e9f67..2e487ebd8380 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 ed3ccf1ccb2f..f4ac2d612c07 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 9eabd0920d9c..eed7f80ab3e7 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 1801db97a814..4ef19b1ff0d2 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 9c7ef2e303e7..16c27bd3c428 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) { From 89497cc5bfcabb729e3c255bb4d5aa06ff85b1cf Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 12:35:49 +0100 Subject: [PATCH 02/17] updates --- log/testing.go | 2 +- server/api/server.go | 6 +++--- server/mock/helpers.go | 9 +-------- server/start.go | 2 +- testutil/mock/logger.go | 15 +++++++++++++++ testutil/network/util.go | 4 ++-- 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/log/testing.go b/log/testing.go index adeb7a649883..f9873ba32a99 100644 --- a/log/testing.go +++ b/log/testing.go @@ -11,7 +11,7 @@ func NewTestingLogger() Logger { } if testing.Verbose() { - _testingLogger = NewLogger() + _testingLogger = NewLoggerWithKV(ModuleKey, "test") } else { _testingLogger = NewNopLogger() } diff --git a/server/api/server.go b/server/api/server.go index 267e64b5a28c..0f5090da1bcc 100644 --- a/server/api/server.go +++ b/server/api/server.go @@ -21,7 +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" + servercmtlog "github.com/cosmos/cosmos-sdk/server/log" "github.com/cosmos/cosmos-sdk/telemetry" grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" ) @@ -149,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), logwrp.CometZeroLogWrapper{Logger: s.logger}, cmtCfg) + errCh <- tmrpcserver.Serve(s.listener, allowAllCORS(s.Router), servercmtlog.CometZeroLogWrapper{Logger: s.logger}, cmtCfg) } else { - errCh <- tmrpcserver.Serve(s.listener, s.Router, logwrp.CometZeroLogWrapper{Logger: s.logger}, cmtCfg) + errCh <- tmrpcserver.Serve(s.listener, s.Router, servercmtlog.CometZeroLogWrapper{Logger: s.logger}, cmtCfg) } }(cfg.API.EnableUnsafeCORS) diff --git a/server/mock/helpers.go b/server/mock/helpers.go index 42f5ad984ea1..ce0d6416a2e8 100644 --- a/server/mock/helpers.go +++ b/server/mock/helpers.go @@ -3,7 +3,6 @@ package mock import ( "fmt" "os" - "testing" "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" @@ -12,13 +11,7 @@ import ( // 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 log.Logger - if testing.Verbose() { - logger = log.NewLoggerWithKV("module", "mock") - } else { - logger = log.NewNopLogger() - } - + logger := log.NewTestingLogger() rootDir, err := os.MkdirTemp("", "mock-sdk") if err != nil { return nil, nil, err diff --git a/server/start.go b/server/start.go index 5e4fb614951d..5469c1923cf0 100644 --- a/server/start.go +++ b/server/start.go @@ -230,7 +230,7 @@ func startStandAlone(svrCtx *Context, appCreator types.AppCreator) error { return fmt.Errorf("error creating listener: %v", err) } - svr.SetLogger(servercmtlog.CometZeroLogWrapper{svrCtx.Logger.With("module", "abci-server")}) + svr.SetLogger(servercmtlog.CometZeroLogWrapper{Logger: svrCtx.Logger.With("module", "abci-server")}) ctx, cancelFn := context.WithCancel(context.Background()) g, ctx := errgroup.WithContext(ctx) diff --git a/testutil/mock/logger.go b/testutil/mock/logger.go index 0bd2e723c568..d37c864e6f48 100644 --- a/testutil/mock/logger.go +++ b/testutil/mock/logger.go @@ -9,6 +9,7 @@ import ( log "cosmossdk.io/log" gomock "github.com/golang/mock/gomock" + zerolog "github.com/rs/zerolog" ) // MockLogger is a mock of Logger interface. @@ -68,6 +69,20 @@ func (mr *MockLoggerMockRecorder) Error(arg0 interface{}, arg1 ...interface{}) * return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockLogger)(nil).Error), varargs...) } +// Impl mocks base method. +func (m *MockLogger) Impl() *zerolog.Logger { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Impl") + ret0, _ := ret[0].(*zerolog.Logger) + return ret0 +} + +// Impl indicates an expected call of Impl. +func (mr *MockLoggerMockRecorder) Impl() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Impl", reflect.TypeOf((*MockLogger)(nil).Impl)) +} + // Info mocks base method. func (m *MockLogger) Info(arg0 string, arg1 ...interface{}) { m.ctrl.T.Helper() diff --git a/testutil/network/util.go b/testutil/network/util.go index adef300d68eb..247a7ffccf92 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -19,7 +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" + servercmtlog "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" @@ -58,7 +58,7 @@ func startInProcess(cfg Config, val *Validator) error { appGenesisProvider, node.DefaultDBProvider, node.DefaultMetricsProvider(cmtCfg.Instrumentation), - logwrp.CometZeroLogWrapper{Logger: logger.With("module", val.Moniker)}, + servercmtlog.CometZeroLogWrapper{Logger: logger.With("module", val.Moniker)}, ) if err != nil { return err From 12b8dd75e45f4d20f378a2760b85da46779fa779 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 12:59:28 +0100 Subject: [PATCH 03/17] godoc + simplify interface --- log/logger.go | 22 +++++++++++++++------- tools/cosmovisor/cmd/cosmovisor/version.go | 6 ++---- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/log/logger.go b/log/logger.go index aebef5c2f810..769852fbfc04 100644 --- a/log/logger.go +++ b/log/logger.go @@ -13,13 +13,27 @@ const ModuleKey = "module" // ContextKey is used to store the logger in the context var ContextKey struct{} +// Logger is the Cosmos SDK logger interface +// It aimed to be used as a wrapper around zerolog +// It maintains as much backward compatibility with the CometBFT logger as possible (use server.CometZeroLogWrapper for 100% compatibility) +// All functionalities of Zerolog are available through the Impl() method type Logger interface { + // 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. Info(msg string, keyVals ...interface{}) + + // 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. Error(msg string, keyVals ...interface{}) + + // 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. Debug(msg string, keyVals ...interface{}) + + // With returns a new wrapped logger with additional context provided by a set With(keyVals ...interface{}) Logger - Level(lvl zerolog.Level) Logger + // Impl returns the underlying zerolog logger Impl() *zerolog.Logger } @@ -76,12 +90,6 @@ func (l ZeroLogWrapper) With(keyVals ...interface{}) 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} -} - // 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 { diff --git a/tools/cosmovisor/cmd/cosmovisor/version.go b/tools/cosmovisor/cmd/cosmovisor/version.go index 40e8d7f51e03..5edafec9d358 100644 --- a/tools/cosmovisor/cmd/cosmovisor/version.go +++ b/tools/cosmovisor/cmd/cosmovisor/version.go @@ -57,8 +57,8 @@ func printVersionJSON(logger log.Logger, args []string) error { buf := new(strings.Builder) // disable logger - l := logger.Level(zerolog.Disabled) - logger = l + l := logger.Impl().Level(zerolog.Disabled) + logger = log.NewCustomLogger(l) if err := Run( logger, @@ -76,8 +76,6 @@ func printVersionJSON(logger log.Logger, args []string) error { AppVersion: json.RawMessage(buf.String()), }) if err != nil { - l := logger.Level(zerolog.TraceLevel) - logger = l return fmt.Errorf("can't print version output, expected valid json from APP, got: %s - %w", buf.String(), err) } From 5a778d61c0106042bc1da958b086c466da8a87ca Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 13:02:04 +0100 Subject: [PATCH 04/17] bump log --- client/v2/go.mod | 2 +- client/v2/go.sum | 4 ++-- go.mod | 4 ++-- go.sum | 4 ++-- simapp/go.mod | 2 +- simapp/go.sum | 4 ++-- store/go.mod | 4 +--- store/go.sum | 2 ++ tests/go.mod | 2 +- tests/go.sum | 4 ++-- tools/confix/go.mod | 2 +- tools/confix/go.sum | 4 ++-- tools/cosmovisor/go.mod | 2 +- tools/cosmovisor/go.sum | 4 ++-- tools/hubl/go.mod | 2 +- tools/hubl/go.sum | 4 ++-- tools/rosetta/go.mod | 2 +- tools/rosetta/go.sum | 4 ++-- x/circuit/go.mod | 2 +- x/circuit/go.sum | 4 ++-- x/evidence/go.mod | 2 +- x/evidence/go.sum | 4 ++-- x/feegrant/go.mod | 2 +- x/feegrant/go.sum | 4 ++-- x/nft/go.mod | 2 +- x/nft/go.sum | 4 ++-- x/upgrade/go.mod | 2 +- x/upgrade/go.sum | 4 ++-- 28 files changed, 43 insertions(+), 43 deletions(-) diff --git a/client/v2/go.mod b/client/v2/go.mod index 2356e793dff2..cf3b79556d61 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-20230227110325-294ef34f396f // indirect + cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f // 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 9a1b9dec8d55..aacc3389396c 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-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= -cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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 25c02235d0ab..c1480728645e 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ 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-20230227110325-294ef34f396f + cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 cosmossdk.io/x/tx v0.2.0 @@ -46,6 +46,7 @@ require ( github.com/prometheus/client_golang v1.14.0 github.com/prometheus/common v0.40.0 github.com/rakyll/statik v0.1.7 + github.com/rs/zerolog v1.29.0 github.com/spf13/cast v1.5.0 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 @@ -136,7 +137,6 @@ 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/jwalterweatherman v1.1.0 // indirect diff --git a/go.sum b/go.sum index f8f944fe9569..ae85fe7ad8aa 100644 --- a/go.sum +++ b/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-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= -cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/simapp/go.mod b/simapp/go.mod index 1764384abcea..12f9d0ed5939 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -7,7 +7,7 @@ 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-20230227110325-294ef34f396f + cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 cosmossdk.io/tools/confix v0.0.0-20230120150717-4f6f6c00021f diff --git a/simapp/go.sum b/simapp/go.sum index e3dd19ab2b36..a38c7a2f5319 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -200,8 +200,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-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= -cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/store/go.mod b/store/go.mod index 3b669a7fc785..d7716a4d98b8 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-20230227110325-294ef34f396f + cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f 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 @@ -75,5 +75,3 @@ 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 a1b7e3d89359..5563246b3e25 100644 --- a/store/go.sum +++ b/store/go.sum @@ -1,6 +1,8 @@ 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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= diff --git a/tests/go.mod b/tests/go.mod index 88fb9e181589..c4ccb3f2e109 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -6,7 +6,7 @@ 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-20230227110325-294ef34f396f + cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f 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-20230227103508-bbe7f8a11b44 diff --git a/tests/go.sum b/tests/go.sum index 2c2c42816514..98fc19b790f0 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -198,8 +198,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-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= -cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/tools/confix/go.mod b/tools/confix/go.mod index b62a9a251b96..c64aa64b4dac 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-20230227110325-294ef34f396f // indirect + cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f // 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 5a72f7bed97a..3ec219c3edaa 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-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= -cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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/go.mod b/tools/cosmovisor/go.mod index d40525e7376f..de0e6550d60f 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/tools/cosmovisor go 1.20 require ( - cosmossdk.io/log v0.0.0-20230227112847-24f67e52fa98 + cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f cosmossdk.io/x/upgrade v0.0.0-20230227110325-294ef34f396f github.com/otiai10/copy v1.9.0 github.com/rs/zerolog v1.29.0 diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index 24294f70099c..1c811df1b81b 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -198,8 +198,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-20230227112847-24f67e52fa98 h1:Ajdx9YJ7yOJSUZ4kYcpS8q8c/5Lxn0x+blPM5Aqf5jk= -cosmossdk.io/log v0.0.0-20230227112847-24f67e52fa98/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index aea1117f8525..8cb07e132043 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-20230227110325-294ef34f396f // indirect + cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f // 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 3f79d13561b2..201014980bc4 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-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= -cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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/go.mod b/tools/rosetta/go.mod index ab91f853a425..583ab0b60707 100644 --- a/tools/rosetta/go.mod +++ b/tools/rosetta/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/tools/rosetta go 1.19 require ( - cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f + cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f 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 diff --git a/tools/rosetta/go.sum b/tools/rosetta/go.sum index b57ffb9b92df..71e56ba910ef 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-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= -cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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/x/circuit/go.mod b/x/circuit/go.mod index 1520d4132913..267d12f5e5b0 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -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-20230227110325-294ef34f396f // indirect + cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f // 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 56f27d63c0ff..c6dd376e1a27 100644 --- a/x/circuit/go.sum +++ b/x/circuit/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-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= -cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/x/evidence/go.mod b/x/evidence/go.mod index 4a8dd15db146..5f59859d7e5d 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -7,7 +7,7 @@ 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-20230227110325-294ef34f396f + cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 github.com/cometbft/cometbft v0.37.0-alpha.3 diff --git a/x/evidence/go.sum b/x/evidence/go.sum index afea78221184..d07cb72f22ff 100644 --- a/x/evidence/go.sum +++ b/x/evidence/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-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= -cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index 4b6e0179ab1b..ce5e4b8bed4d 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -7,7 +7,7 @@ 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-20230227110325-294ef34f396f + cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 github.com/cometbft/cometbft v0.37.0-alpha.3 diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index b0b3ac716586..5e66b660daa1 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/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-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= -cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/x/nft/go.mod b/x/nft/go.mod index 4b8ef8d6e1c6..e2c6e8f26c3d 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -24,7 +24,7 @@ require ( require ( cosmossdk.io/collections v0.0.0-20230214153846-b6c6e4e99177 // indirect - cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f // indirect + cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f // 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 diff --git a/x/nft/go.sum b/x/nft/go.sum index afea78221184..d07cb72f22ff 100644 --- a/x/nft/go.sum +++ b/x/nft/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-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= -cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 0185eb0ff935..47fc5eff98b0 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -7,7 +7,7 @@ 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-20230227110325-294ef34f396f + cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f 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 diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index 2e487ebd8380..714beb9104b5 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -198,8 +198,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-20230227110325-294ef34f396f h1:8qg6pvpG4+K2woMBGIPvMDKJ4tlKZjYU+eX9ITY5iuA= -cosmossdk.io/log v0.0.0-20230227110325-294ef34f396f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= +cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= From e8f244012ae0f41be4b5c876ac03e2df166693d4 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 13:07:45 +0100 Subject: [PATCH 05/17] make interface not depend of zerolog --- log/bench_test.go | 7 ++++--- log/logger.go | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/log/bench_test.go b/log/bench_test.go index 5e6beb8b430c..756d9e1d3df7 100644 --- a/log/bench_test.go +++ b/log/bench_test.go @@ -116,10 +116,11 @@ func BenchmarkLoggers_StructuredVsFields(b *testing.B) { b.Run("logger structured", func(b *testing.B) { zl := zerolog.New(io.Discard) var logger log.Logger = log.ZeroLogWrapper{Logger: &zl} + zerolog := logger.Impl().(*zerolog.Logger) 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(). + zerolog.Info().Int64("foo", 100000).Msg(message) + zerolog.Info().Str("foo", "foo").Msg(message) + zerolog.Error(). Int64("foo", 100000). Str("bar", "foo"). Bytes("other", []byte{0xde, 0xad, 0xbe, 0xef}). diff --git a/log/logger.go b/log/logger.go index 769852fbfc04..b521d884cd5a 100644 --- a/log/logger.go +++ b/log/logger.go @@ -33,8 +33,9 @@ type Logger interface { // With returns a new wrapped logger with additional context provided by a set With(keyVals ...interface{}) Logger - // Impl returns the underlying zerolog logger - Impl() *zerolog.Logger + // Impl returns the underlying logger implementation + // It is used to access the full functionality of the underlying logger + Impl() interface{} } type ZeroLogWrapper struct { @@ -92,6 +93,6 @@ func (l ZeroLogWrapper) With(keyVals ...interface{}) 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 { +func (l ZeroLogWrapper) Impl() interface{} { return l.Logger } From 5b10d949dc559030dea2238907cf7d27b8d38cdf Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 13:19:36 +0100 Subject: [PATCH 06/17] use new interface in cosmovisor and rosetta --- tools/cosmovisor/args.go | 6 ++--- tools/cosmovisor/cmd/cosmovisor/run.go | 2 +- tools/cosmovisor/cmd/cosmovisor/version.go | 4 ++-- tools/cosmovisor/go.mod | 2 +- tools/cosmovisor/go.sum | 4 ++-- tools/cosmovisor/process.go | 26 ++++++++++++---------- tools/cosmovisor/scanner.go | 4 +++- tools/cosmovisor/upgrade.go | 9 ++++---- tools/cosmovisor/upgrade_test.go | 5 +++-- tools/rosetta/go.mod | 4 ++-- tools/rosetta/go.sum | 10 ++++----- 11 files changed, 41 insertions(+), 35 deletions(-) diff --git a/tools/cosmovisor/args.go b/tools/cosmovisor/args.go index 8cfb9444068d..45358412b314 100644 --- a/tools/cosmovisor/args.go +++ b/tools/cosmovisor/args.go @@ -249,7 +249,7 @@ func (cfg *Config) validate() []error { } // check the DataBackupPath - if cfg.UnsafeSkipBackup == true { + if cfg.UnsafeSkipBackup { return errs } @@ -364,8 +364,8 @@ func (cfg Config) DetailString() string { {EnvName, cfg.Name}, {EnvDownloadBin, fmt.Sprintf("%t", cfg.AllowDownloadBinaries)}, {EnvRestartUpgrade, fmt.Sprintf("%t", cfg.RestartAfterUpgrade)}, - {EnvRestartDelay, fmt.Sprintf("%s", cfg.RestartDelay)}, - {EnvInterval, fmt.Sprintf("%s", cfg.PollInterval)}, + {EnvRestartDelay, cfg.RestartDelay.String()}, + {EnvInterval, cfg.PollInterval.String()}, {EnvSkipBackup, fmt.Sprintf("%t", cfg.UnsafeSkipBackup)}, {EnvDataBackupPath, cfg.DataBackupPath}, {EnvPreupgradeMaxRetries, fmt.Sprintf("%d", cfg.PreupgradeMaxRetries)}, diff --git a/tools/cosmovisor/cmd/cosmovisor/run.go b/tools/cosmovisor/cmd/cosmovisor/run.go index 13e6ae15a1e4..5c91c77c1108 100644 --- a/tools/cosmovisor/cmd/cosmovisor/run.go +++ b/tools/cosmovisor/cmd/cosmovisor/run.go @@ -42,7 +42,7 @@ func Run(logger log.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.Impl().Info().Str("app", cfg.Name).Msg("upgrade detected, relaunching") + logger.Info("upgrade detected, relaunching", "app", cfg.Name) doUpgrade, err = launcher.Run(args, runCfg.StdOut, runCfg.StdErr) } diff --git a/tools/cosmovisor/cmd/cosmovisor/version.go b/tools/cosmovisor/cmd/cosmovisor/version.go index 5edafec9d358..722ccc5e9388 100644 --- a/tools/cosmovisor/cmd/cosmovisor/version.go +++ b/tools/cosmovisor/cmd/cosmovisor/version.go @@ -57,8 +57,8 @@ func printVersionJSON(logger log.Logger, args []string) error { buf := new(strings.Builder) // disable logger - l := logger.Impl().Level(zerolog.Disabled) - logger = log.NewCustomLogger(l) + zl := logger.Impl().(*zerolog.Logger) + logger = log.NewCustomLogger(zl.Level(zerolog.Disabled)) if err := Run( logger, diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index de0e6550d60f..46e4f819b4f0 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/tools/cosmovisor go 1.20 require ( - cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f + cosmossdk.io/log v0.0.0-20230227120745-e8f244012ae0 cosmossdk.io/x/upgrade v0.0.0-20230227110325-294ef34f396f github.com/otiai10/copy v1.9.0 github.com/rs/zerolog v1.29.0 diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index 1c811df1b81b..b29858cbd962 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -198,8 +198,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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= -cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227120745-e8f244012ae0 h1:VPDle4a4BlwSWdyxP8ZQ8TaoYkgErycafGDcALFUT5w= +cosmossdk.io/log v0.0.0-20230227120745-e8f244012ae0/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/tools/cosmovisor/process.go b/tools/cosmovisor/process.go index 42db794ada8d..bdac5c8f8e7c 100644 --- a/tools/cosmovisor/process.go +++ b/tools/cosmovisor/process.go @@ -14,6 +14,7 @@ import ( "time" "github.com/otiai10/copy" + "github.com/rs/zerolog" "cosmossdk.io/log" "cosmossdk.io/x/upgrade/plan" @@ -21,7 +22,7 @@ import ( ) type Launcher struct { - logger log.Logger + logger *zerolog.Logger cfg *Config fw *fileWatcher } @@ -32,7 +33,8 @@ func NewLauncher(logger log.Logger, cfg *Config) (Launcher, error) { return Launcher{}, err } - return Launcher{logger: logger, cfg: cfg, fw: fw}, nil + zl := logger.Impl().(*zerolog.Logger) + return Launcher{logger: zl, cfg: cfg, fw: fw}, nil } // Run launches the app in a subprocess and returns when the subprocess (app) @@ -48,7 +50,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.Impl().Info().Str("path", bin).Strs("args", args).Msg("running app") + l.logger.Info().Str("path", bin).Strs("args", args).Msg("running app") cmd := exec.Command(bin, args...) cmd.Stdout = stdout cmd.Stderr = stderr @@ -61,7 +63,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.Impl().Fatal().Err(err).Str("bin", bin).Msg("terminated") + l.logger.Fatal().Err(err).Str("bin", bin).Msg("terminated") } }() @@ -100,7 +102,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.Impl().Error().Err(err) + l.logger.Error().Err(err) } cmdDone := make(chan error) @@ -111,7 +113,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("daemon shutting down in an attempt to restart") + l.logger.Info().Msg("daemon shutting down in an attempt to restart") _ = cmd.Process.Kill() case err := <-cmdDone: l.fw.Stop() @@ -151,7 +153,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.Impl().Info().Time("backup start time", st).Msg("starting to take backup of data directory") + l.logger.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 +162,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.Impl().Info().Str("backup saved at", dst).Time("backup completion time", et).TimeDiff("time taken to complete backup", et, st).Msg("backup completed") + l.logger.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 +183,17 @@ func (l *Launcher) doPreUpgrade() error { switch err.(*exec.ExitError).ProcessState.ExitCode() { case 1: - l.logger.Info("pre-upgrade command does not exist. continuing the upgrade.") + l.logger.Info().Msg("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.Impl().Error().Err(err).Int("attempt", counter).Msg("pre-upgrade command failed. retrying") + l.logger.Error().Err(err).Int("attempt", counter).Msg("pre-upgrade command failed. retrying") continue } } - l.logger.Info("pre-upgrade successful. continuing the upgrade.") + l.logger.Info().Msg("pre-upgrade successful. continuing the upgrade.") return nil } } @@ -209,7 +211,7 @@ func (l *Launcher) executePreUpgradeCmd() error { return err } - l.logger.Impl().Info().Bytes("result", result).Msg("pre-upgrade result") + l.logger.Info().Bytes("result", result).Msg("pre-upgrade result") return nil } diff --git a/tools/cosmovisor/scanner.go b/tools/cosmovisor/scanner.go index d616e06ab848..506e993de379 100644 --- a/tools/cosmovisor/scanner.go +++ b/tools/cosmovisor/scanner.go @@ -11,6 +11,7 @@ import ( "cosmossdk.io/log" upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/rs/zerolog" ) type fileWatcher struct { @@ -110,7 +111,8 @@ func (fw *fileWatcher) CheckUpdate(currentUpgrade upgradetypes.Plan) bool { info, err := parseUpgradeInfoFile(fw.filename) if err != nil { - fw.logger.Impl().Fatal().Err(err).Msg("failed to parse upgrade info file") + zl := fw.logger.Impl().(*zerolog.Logger) + zl.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 65d49bf82126..c42306332cfe 100644 --- a/tools/cosmovisor/upgrade.go +++ b/tools/cosmovisor/upgrade.go @@ -6,7 +6,8 @@ import ( "os" "runtime" - "cosmossdk.io/log" + "github.com/rs/zerolog" + "cosmossdk.io/x/upgrade/plan" upgradetypes "cosmossdk.io/x/upgrade/types" ) @@ -14,7 +15,7 @@ import ( // 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 log.Logger, cfg *Config, p upgradetypes.Plan) error { +func UpgradeBinary(logger *zerolog.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 +55,11 @@ func UpgradeBinary(logger log.Logger, cfg *Config, p upgradetypes.Plan) error { } // If not there, then we try to download it... maybe - logger.Info("no upgrade binary found, beginning to download it") + logger.Info().Msg("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("downloading binary complete") + logger.Info().Msg("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 3b976a753997..1ba44fd6b8bc 100644 --- a/tools/cosmovisor/upgrade_test.go +++ b/tools/cosmovisor/upgrade_test.go @@ -11,6 +11,7 @@ import ( "testing" "github.com/otiai10/copy" + "github.com/rs/zerolog" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -94,7 +95,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.NewLoggerWithKV(log.ModuleKey, "cosmovisor") + logger := log.NewLoggerWithKV(log.ModuleKey, "cosmovisor").Impl().(*zerolog.Logger) currentBin, err := cfg.CurrentBin() s.Require().NoError(err) @@ -127,7 +128,7 @@ func (s *upgradeTestSuite) TestUpgradeBinaryNoDownloadUrl() { } func (s *upgradeTestSuite) TestUpgradeBinary() { - logger := log.NewLoggerWithKV(log.ModuleKey, "cosmovisor") + logger := log.NewLoggerWithKV(log.ModuleKey, "cosmovisor").Impl().(*zerolog.Logger) cases := map[string]struct { url string diff --git a/tools/rosetta/go.mod b/tools/rosetta/go.mod index 583ab0b60707..08c49e3d5bbc 100644 --- a/tools/rosetta/go.mod +++ b/tools/rosetta/go.mod @@ -7,7 +7,7 @@ require ( 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/cosmos-sdk v0.46.0-beta2.0.20230227115928-12b8dd75e45f github.com/cosmos/rosetta-sdk-go v0.10.0 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 github.com/spf13/cobra v1.6.1 @@ -22,7 +22,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/store v0.0.0-20230206092147-e03195e4b8a7 // indirect + cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 // 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 diff --git a/tools/rosetta/go.sum b/tools/rosetta/go.sum index 71e56ba910ef..8be2c23ec016 100644 --- a/tools/rosetta/go.sum +++ b/tools/rosetta/go.sum @@ -49,8 +49,8 @@ cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzv cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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= @@ -121,8 +121,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= @@ -170,8 +170,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.20230227115928-12b8dd75e45f h1:bwRyrRxAixdPgmG4EAJ82zhF5z2nyAVsaAZmAS5woJU= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227115928-12b8dd75e45f/go.mod h1:L41/+FnSwdpLbzgmWfptm8cBZ219swN71k/XEu57tB8= 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= From a707cce7feee9b1e62ace00fae89972d2cae1c00 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 13:41:57 +0100 Subject: [PATCH 07/17] updates --- go.mod | 2 +- go.sum | 4 ++-- log/logger.go | 3 ++- server/cmd/execute.go | 3 ++- server/util.go | 31 +++++++++++++++++++------------ simapp/go.mod | 2 +- simapp/go.sum | 4 ++-- tests/go.mod | 2 +- tests/go.sum | 4 ++-- tools/confix/go.mod | 5 +++-- tools/confix/go.sum | 11 ++++++----- 11 files changed, 41 insertions(+), 30 deletions(-) diff --git a/go.mod b/go.mod index c1480728645e..81a97a566abd 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ 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-20230227115928-12b8dd75e45f + cosmossdk.io/log v0.0.0-20230227121936-5b10d949dc55 cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 cosmossdk.io/x/tx v0.2.0 diff --git a/go.sum b/go.sum index ae85fe7ad8aa..c4feece0aa49 100644 --- a/go.sum +++ b/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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= -cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227121936-5b10d949dc55 h1:F5xogf0vjyhgPjQ9t17zqe9KwXD+1Wu0Q6cADvEfXxs= +cosmossdk.io/log v0.0.0-20230227121936-5b10d949dc55/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/log/logger.go b/log/logger.go index b521d884cd5a..bc20adbf7fbe 100644 --- a/log/logger.go +++ b/log/logger.go @@ -34,7 +34,8 @@ type Logger interface { With(keyVals ...interface{}) Logger // Impl returns the underlying logger implementation - // It is used to access the full functionality of the underlying logger + // It is used to access the full functionalities of the underlying logger + // Advanced users can type cast the returned value to the actual logger Impl() interface{} } diff --git a/server/cmd/execute.go b/server/cmd/execute.go index bc1326893a21..c7842c690cb0 100644 --- a/server/cmd/execute.go +++ b/server/cmd/execute.go @@ -5,6 +5,7 @@ import ( cmtcfg "github.com/cometbft/cometbft/config" cmtcli "github.com/cometbft/cometbft/libs/cli" + "github.com/rs/zerolog" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" @@ -25,7 +26,7 @@ func Execute(rootCmd *cobra.Command, envPrefix string, defaultHome string) error // https://github.com/spf13/cobra/pull/1118. ctx := CreateExecuteContext(context.Background()) - rootCmd.PersistentFlags().String(flags.FlagLogLevel, cmtcfg.DefaultLogLevel, "The logging level (trace|debug|info|warn|error|fatal|panic)") + rootCmd.PersistentFlags().String(flags.FlagLogLevel, zerolog.InfoLevel.String(), "The logging level (trace|debug|info|warn|error|fatal|panic)") rootCmd.PersistentFlags().String(flags.FlagLogFormat, cmtcfg.LogFormatPlain, "The logging format (json|plain)") executor := cmtcli.PrepareBaseCmd(rootCmd, envPrefix, defaultHome) diff --git a/server/util.go b/server/util.go index a96cd671ec14..4df0ca5a05d9 100644 --- a/server/util.go +++ b/server/util.go @@ -17,7 +17,9 @@ import ( cmtcmd "github.com/cometbft/cometbft/cmd/cometbft/commands" cmtcfg "github.com/cometbft/cometbft/config" + cmtcli "github.com/cometbft/cometbft/libs/cli" dbm "github.com/cosmos/cosmos-db" + "github.com/rs/zerolog" "github.com/spf13/cast" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -153,21 +155,26 @@ func InterceptConfigsPreRunHandler(cmd *cobra.Command, customAppConfigTemplate s var logger log.Logger if serverCtx.Viper.GetString(flags.FlagLogFormat) == cmtcfg.LogFormatJSON { - logger = log.NewLogger() + zl := zerolog.New(os.Stdout).With().Timestamp().Logger() + logger = log.NewCustomLogger(zl) } else { - // 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) - // } + + logLvlStr := serverCtx.Viper.GetString(flags.FlagLogLevel) + logLvl, err := zerolog.ParseLevel(logLvlStr) + if err != nil { + return fmt.Errorf("failed to parse log level (%s): %w", logLvlStr, err) + } + + zl := logger.Impl().(*zerolog.Logger) + logger = log.NewCustomLogger(zl.Level(logLvl)) + + // Check if the CometBFT flag for trace logging is set if it is then setup a tracing logger in this app as well. + // Note it overrides log level passed in `log_levels`. + if serverCtx.Viper.GetBool(cmtcli.TraceFlag) { + logger = log.NewCustomLogger(zl.Level(zerolog.TraceLevel)) + } serverCtx.Logger = logger.With("module", "server") diff --git a/simapp/go.mod b/simapp/go.mod index 12f9d0ed5939..de5986ddc309 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -7,7 +7,7 @@ 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-20230227115928-12b8dd75e45f + cosmossdk.io/log v0.0.0-20230227121936-5b10d949dc55 cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 cosmossdk.io/tools/confix v0.0.0-20230120150717-4f6f6c00021f diff --git a/simapp/go.sum b/simapp/go.sum index a38c7a2f5319..6e19e7e24135 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -200,8 +200,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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= -cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227121936-5b10d949dc55 h1:F5xogf0vjyhgPjQ9t17zqe9KwXD+1Wu0Q6cADvEfXxs= +cosmossdk.io/log v0.0.0-20230227121936-5b10d949dc55/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/tests/go.mod b/tests/go.mod index c4ccb3f2e109..e935b67f52b8 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -6,7 +6,7 @@ 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-20230227115928-12b8dd75e45f + cosmossdk.io/log v0.0.0-20230227121936-5b10d949dc55 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-20230227103508-bbe7f8a11b44 diff --git a/tests/go.sum b/tests/go.sum index 98fc19b790f0..679806ff01e0 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -198,8 +198,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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= -cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227121936-5b10d949dc55 h1:F5xogf0vjyhgPjQ9t17zqe9KwXD+1Wu0Q6cADvEfXxs= +cosmossdk.io/log v0.0.0-20230227121936-5b10d949dc55/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/tools/confix/go.mod b/tools/confix/go.mod index c64aa64b4dac..662a86303776 100644 --- a/tools/confix/go.mod +++ b/tools/confix/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/tools/confix go 1.19 require ( - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230221204830-dbc4d104b26f + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227121936-5b10d949dc55 github.com/creachadair/atomicfile v0.2.8 github.com/creachadair/tomledit v0.0.24 github.com/spf13/cobra v1.6.1 @@ -20,7 +20,7 @@ require ( cosmossdk.io/errors v1.0.0-beta.7 // indirect cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f // 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 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 @@ -139,6 +139,7 @@ require ( go.etcd.io/bbolt v1.3.6 // indirect golang.org/x/crypto v0.6.0 // 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/tools/confix/go.sum b/tools/confix/go.sum index 3ec219c3edaa..a196816d08f0 100644 --- a/tools/confix/go.sum +++ b/tools/confix/go.sum @@ -49,8 +49,8 @@ cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzv cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/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.20230227121936-5b10d949dc55 h1:sEU/83kh4wrehmcteXZKxttuOtfbso7BIZFGJAjO6qk= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230227121936-5b10d949dc55/go.mod h1:2Gxu5zkrMOVJxbL9o1gCD4bsNGXE2sWMs+6qMPACwcc= 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= @@ -995,6 +995,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= From 17a7394c067de56fd16f4b4c29c00703d44163e1 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 14:00:20 +0100 Subject: [PATCH 08/17] updates --- client/flags/flags.go | 2 +- server/util.go | 1 + testutil/mock/logger.go | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/flags/flags.go b/client/flags/flags.go index 148965de471d..c06aad1e6b07 100644 --- a/client/flags/flags.go +++ b/client/flags/flags.go @@ -88,7 +88,7 @@ const ( // This differs from FlagOutputDocument that is used to set the output file. FlagOutput = cmtcli.OutputFlag - // CometBFT logging flags + // Logging flags FlagLogLevel = "log_level" FlagLogFormat = "log_format" ) diff --git a/server/util.go b/server/util.go index 4df0ca5a05d9..6c92d05ffff4 100644 --- a/server/util.go +++ b/server/util.go @@ -161,6 +161,7 @@ func InterceptConfigsPreRunHandler(cmd *cobra.Command, customAppConfigTemplate s logger = log.NewLogger() } + // TODO: Add filtering to zerolog logLvlStr := serverCtx.Viper.GetString(flags.FlagLogLevel) logLvl, err := zerolog.ParseLevel(logLvlStr) if err != nil { diff --git a/testutil/mock/logger.go b/testutil/mock/logger.go index d37c864e6f48..b17f076d0255 100644 --- a/testutil/mock/logger.go +++ b/testutil/mock/logger.go @@ -9,7 +9,6 @@ import ( log "cosmossdk.io/log" gomock "github.com/golang/mock/gomock" - zerolog "github.com/rs/zerolog" ) // MockLogger is a mock of Logger interface. @@ -70,10 +69,10 @@ func (mr *MockLoggerMockRecorder) Error(arg0 interface{}, arg1 ...interface{}) * } // Impl mocks base method. -func (m *MockLogger) Impl() *zerolog.Logger { +func (m *MockLogger) Impl() interface{} { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Impl") - ret0, _ := ret[0].(*zerolog.Logger) + ret0, _ := ret[0].(interface{}) return ret0 } From f2849790adb7f9fa6ba99560b8159420fcdc80d0 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 16:51:16 +0100 Subject: [PATCH 09/17] filtering --- log/CHANGELOG.md | 4 ---- log/logger.go | 24 +++++++++++++++++++++--- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/log/CHANGELOG.md b/log/CHANGELOG.md index a8878a1aa30f..16de809f2717 100644 --- a/log/CHANGELOG.md +++ b/log/CHANGELOG.md @@ -30,7 +30,3 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog ## [Unreleased] - -### Improvements - -* [#15158](https://github.com/cosmos/cosmos-sdk/pull/15158) Ensure zero allocations during logging calls to Debug(), Info(), Error() diff --git a/log/logger.go b/log/logger.go index bc20adbf7fbe..30c520d12f71 100644 --- a/log/logger.go +++ b/log/logger.go @@ -14,9 +14,8 @@ const ModuleKey = "module" var ContextKey struct{} // Logger is the Cosmos SDK logger interface -// It aimed to be used as a wrapper around zerolog -// It maintains as much backward compatibility with the CometBFT logger as possible (use server.CometZeroLogWrapper for 100% compatibility) -// All functionalities of Zerolog are available through the Impl() method +// It maintains as much backward compatibility with the CometBFT logger as possible +// All functionalities of the logger are available through the Impl() method type Logger interface { // 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. @@ -97,3 +96,22 @@ func (l ZeroLogWrapper) With(keyVals ...interface{}) Logger { func (l ZeroLogWrapper) Impl() interface{} { return l.Logger } + +// FilterKeys returns a new logger that filters out all key/value pairs that do not match the filter +// NOTE: this is going significantly slow down the logger +func FilterKeys(logger Logger, filter func(key string, level zerolog.Level) bool) Logger { + zl := logger.Impl().(*zerolog.Logger) + filteredLogger := zl.Hook(zerolog.HookFunc(func(e *zerolog.Event, level zerolog.Level, _ string) { + // TODO implement this in zerolog + // keys := e.GetKeys() + keys := []string{} + for _, key := range keys { + if filter(key, level) { + e.Discard() + break + } + } + })) + + return NewCustomLogger(filteredLogger) +} From a09e474d998710c475c85207e5cd70f2077b5b6c Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 17:24:22 +0100 Subject: [PATCH 10/17] don't leak zerolog implementation details --- log/logger.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/log/logger.go b/log/logger.go index 30c520d12f71..3afc4f37088d 100644 --- a/log/logger.go +++ b/log/logger.go @@ -99,14 +99,14 @@ func (l ZeroLogWrapper) Impl() interface{} { // FilterKeys returns a new logger that filters out all key/value pairs that do not match the filter // NOTE: this is going significantly slow down the logger -func FilterKeys(logger Logger, filter func(key string, level zerolog.Level) bool) Logger { +func FilterKeys(logger Logger, filter func(key, level string) bool) Logger { zl := logger.Impl().(*zerolog.Logger) - filteredLogger := zl.Hook(zerolog.HookFunc(func(e *zerolog.Event, level zerolog.Level, _ string) { - // TODO implement this in zerolog + filteredLogger := zl.Hook(zerolog.HookFunc(func(e *zerolog.Event, lvl zerolog.Level, _ string) { + // TODO wait for https://github.com/rs/zerolog/pull/527 to be merged // keys := e.GetKeys() keys := []string{} for _, key := range keys { - if filter(key, level) { + if filter(key, lvl.String()) { e.Discard() break } From b62444bab662c9fe8654e7359bce665cebf705df Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 17:35:39 +0100 Subject: [PATCH 11/17] improve API --- log/level.go | 13 +++++++++++++ server/util.go | 26 ++++++++++++++++---------- 2 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 log/level.go diff --git a/log/level.go b/log/level.go new file mode 100644 index 000000000000..e1df9f892d02 --- /dev/null +++ b/log/level.go @@ -0,0 +1,13 @@ +package log + +const defaultLogLevelKey = "*" + +// ParseLogLevel parses complex log level +// A comma-separated list of module:level pairs with an optional *:level pair +// (* means all other modules). +// +// Example: +// ParseLogLevel("consensus:debug,mempool:debug,*:error", "info") +func ParseLogLevel(lvl string, defaultLogLevelValue string) (func(key, level string) bool, error) { + return func(key, level string) bool { return true }, nil +} diff --git a/server/util.go b/server/util.go index 6c92d05ffff4..cdd32660152e 100644 --- a/server/util.go +++ b/server/util.go @@ -161,20 +161,26 @@ func InterceptConfigsPreRunHandler(cmd *cobra.Command, customAppConfigTemplate s logger = log.NewLogger() } - // TODO: Add filtering to zerolog + // set filter level or keys for the logger if any logLvlStr := serverCtx.Viper.GetString(flags.FlagLogLevel) logLvl, err := zerolog.ParseLevel(logLvlStr) if err != nil { - return fmt.Errorf("failed to parse log level (%s): %w", logLvlStr, err) - } - - zl := logger.Impl().(*zerolog.Logger) - logger = log.NewCustomLogger(zl.Level(logLvl)) + // If the log level is not a valid zerolog level, then we try to parse it as a key filter. + filterFunc, err := log.ParseLogLevel(logLvlStr, zerolog.InfoLevel.String()) + if err != nil { + return fmt.Errorf("failed to parse log level (%s): %w", logLvlStr, err) + } - // Check if the CometBFT flag for trace logging is set if it is then setup a tracing logger in this app as well. - // Note it overrides log level passed in `log_levels`. - if serverCtx.Viper.GetBool(cmtcli.TraceFlag) { - logger = log.NewCustomLogger(zl.Level(zerolog.TraceLevel)) + logger = log.FilterKeys(logger, filterFunc) + } else { + zl := logger.Impl().(*zerolog.Logger) + // Check if the CometBFT flag for trace logging is set if it is then setup a tracing logger in this app as well. + // Note it overrides log level passed in `log_levels`. + if serverCtx.Viper.GetBool(cmtcli.TraceFlag) { + logger = log.NewCustomLogger(zl.Level(zerolog.TraceLevel)) + } else { + logger = log.NewCustomLogger(zl.Level(logLvl)) + } } serverCtx.Logger = logger.With("module", "server") From 5c90b029044f79e58a2206e80f7a6b42aecd4505 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 17:36:47 +0100 Subject: [PATCH 12/17] updates --- go.mod | 2 +- go.sum | 4 ++-- simapp/go.mod | 2 +- simapp/go.sum | 4 ++-- tests/go.mod | 2 +- tests/go.sum | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 81a97a566abd..9796367f66c7 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ 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-20230227121936-5b10d949dc55 + cosmossdk.io/log v0.0.0-20230227163539-b62444bab662 cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 cosmossdk.io/x/tx v0.2.0 diff --git a/go.sum b/go.sum index c4feece0aa49..0ef997bf1d70 100644 --- a/go.sum +++ b/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-20230227121936-5b10d949dc55 h1:F5xogf0vjyhgPjQ9t17zqe9KwXD+1Wu0Q6cADvEfXxs= -cosmossdk.io/log v0.0.0-20230227121936-5b10d949dc55/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227163539-b62444bab662 h1:n34laByI8YkYPnBgo6UmvOnbDgxtHjww9Ofc+r+Q3YM= +cosmossdk.io/log v0.0.0-20230227163539-b62444bab662/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/simapp/go.mod b/simapp/go.mod index de5986ddc309..925896a0403e 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -7,7 +7,7 @@ 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-20230227121936-5b10d949dc55 + cosmossdk.io/log v0.0.0-20230227163539-b62444bab662 cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 cosmossdk.io/tools/confix v0.0.0-20230120150717-4f6f6c00021f diff --git a/simapp/go.sum b/simapp/go.sum index 6e19e7e24135..97249aea3457 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -200,8 +200,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-20230227121936-5b10d949dc55 h1:F5xogf0vjyhgPjQ9t17zqe9KwXD+1Wu0Q6cADvEfXxs= -cosmossdk.io/log v0.0.0-20230227121936-5b10d949dc55/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227163539-b62444bab662 h1:n34laByI8YkYPnBgo6UmvOnbDgxtHjww9Ofc+r+Q3YM= +cosmossdk.io/log v0.0.0-20230227163539-b62444bab662/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/tests/go.mod b/tests/go.mod index e935b67f52b8..93a6c01219b6 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -6,7 +6,7 @@ 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-20230227121936-5b10d949dc55 + cosmossdk.io/log v0.0.0-20230227163539-b62444bab662 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-20230227103508-bbe7f8a11b44 diff --git a/tests/go.sum b/tests/go.sum index 679806ff01e0..807dec12ced5 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -198,8 +198,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-20230227121936-5b10d949dc55 h1:F5xogf0vjyhgPjQ9t17zqe9KwXD+1Wu0Q6cADvEfXxs= -cosmossdk.io/log v0.0.0-20230227121936-5b10d949dc55/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227163539-b62444bab662 h1:n34laByI8YkYPnBgo6UmvOnbDgxtHjww9Ofc+r+Q3YM= +cosmossdk.io/log v0.0.0-20230227163539-b62444bab662/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= From 47f588344201045aa457056f5afc8dc538db900e Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 17:58:09 +0100 Subject: [PATCH 13/17] better documentation --- log/logger.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/log/logger.go b/log/logger.go index 3afc4f37088d..db4fd48ff612 100644 --- a/log/logger.go +++ b/log/logger.go @@ -98,9 +98,14 @@ func (l ZeroLogWrapper) Impl() interface{} { } // FilterKeys returns a new logger that filters out all key/value pairs that do not match the filter -// NOTE: this is going significantly slow down the logger +// This functions assumes that the logger is a zerolog.Logger, which is the case for the logger returned by log.NewLogger() +// NOTE: filtering has a performance impact on the logger func FilterKeys(logger Logger, filter func(key, level string) bool) Logger { - zl := logger.Impl().(*zerolog.Logger) + zl, ok := logger.Impl().(*zerolog.Logger) + if !ok { + panic("logger is not a zerolog.Logger") + } + filteredLogger := zl.Hook(zerolog.HookFunc(func(e *zerolog.Event, lvl zerolog.Level, _ string) { // TODO wait for https://github.com/rs/zerolog/pull/527 to be merged // keys := e.GetKeys() From 808660d8ca476130665f74e38a14bfe7416cc2f1 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 18:00:06 +0100 Subject: [PATCH 14/17] hide more implementation details --- log/bench_test.go | 8 ++++---- log/logger.go | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/log/bench_test.go b/log/bench_test.go index 756d9e1d3df7..f2060df924a1 100644 --- a/log/bench_test.go +++ b/log/bench_test.go @@ -70,7 +70,7 @@ func BenchmarkLoggers(b *testing.B) { for _, bc := range benchCases { checkBuf.Reset() zl := zerolog.New(checkBuf) - logger := log.ZeroLogWrapper{Logger: &zl} + logger := log.NewCustomLogger(zl) logger.Info(message, bc.keyVals...) b.Logf("zero logger output for %s: %s", bc.name, checkBuf.String()) @@ -85,7 +85,7 @@ func BenchmarkLoggers(b *testing.B) { bc := bc b.Run(bc.name, func(b *testing.B) { zl := zerolog.New(io.Discard) - logger := log.ZeroLogWrapper{Logger: &zl} + logger := log.NewCustomLogger(zl) for i := 0; i < b.N; i++ { logger.Info(message, bc.keyVals...) @@ -115,7 +115,7 @@ func BenchmarkLoggers_StructuredVsFields(b *testing.B) { b.Run("logger structured", func(b *testing.B) { zl := zerolog.New(io.Discard) - var logger log.Logger = log.ZeroLogWrapper{Logger: &zl} + var logger log.Logger = log.NewCustomLogger(zl) zerolog := logger.Impl().(*zerolog.Logger) for i := 0; i < b.N; i++ { zerolog.Info().Int64("foo", 100000).Msg(message) @@ -131,7 +131,7 @@ func BenchmarkLoggers_StructuredVsFields(b *testing.B) { b.Run("logger", func(b *testing.B) { zl := zerolog.New(io.Discard) - var logger log.Logger = log.ZeroLogWrapper{Logger: &zl} + var logger log.Logger = log.NewCustomLogger(zl) for i := 0; i < b.N; i++ { logger.Info(message, "foo", 100000) logger.Info(message, "foo", "foo") diff --git a/log/logger.go b/log/logger.go index db4fd48ff612..e93d223cc44c 100644 --- a/log/logger.go +++ b/log/logger.go @@ -38,62 +38,62 @@ type Logger interface { Impl() interface{} } -type ZeroLogWrapper struct { +type zeroLogWrapper struct { *zerolog.Logger } // NewNopLogger returns a new logger that does nothing func NewNopLogger() Logger { logger := zerolog.Nop() - return ZeroLogWrapper{&logger} + 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} + 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} + return zeroLogWrapper{&logger} } // NewCustomLogger returns a new logger with the given zerolog logger func NewCustomLogger(logger zerolog.Logger) Logger { - return ZeroLogWrapper{&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{}) { +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{}) { +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{}) { +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 { +func (l zeroLogWrapper) With(keyVals ...interface{}) Logger { logger := l.Logger.With().Fields(keyVals).Logger() - return ZeroLogWrapper{&logger} + return zeroLogWrapper{&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() interface{} { +func (l zeroLogWrapper) Impl() interface{} { return l.Logger } From 3535ee51c7284e3a2c8afb1aaf02f3c315d96034 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 21:48:52 +0100 Subject: [PATCH 15/17] updates --- log/logger.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/log/logger.go b/log/logger.go index e93d223cc44c..800ef90cdd7d 100644 --- a/log/logger.go +++ b/log/logger.go @@ -19,23 +19,23 @@ var ContextKey struct{} type Logger interface { // 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. - Info(msg string, keyVals ...interface{}) + Info(msg string, keyVals ...any) // 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. - Error(msg string, keyVals ...interface{}) + Error(msg string, keyVals ...any) // 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. - Debug(msg string, keyVals ...interface{}) + Debug(msg string, keyVals ...any) // With returns a new wrapped logger with additional context provided by a set - With(keyVals ...interface{}) Logger + With(keyVals ...any) Logger // Impl returns the underlying logger implementation // It is used to access the full functionalities of the underlying logger // Advanced users can type cast the returned value to the actual logger - Impl() interface{} + Impl() any } type zeroLogWrapper struct { From 36deb1c13ce6df3ca37dcab009034ec6a1d13d95 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 21:59:02 +0100 Subject: [PATCH 16/17] updates --- client/v2/go.mod | 2 +- client/v2/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- simapp/go.mod | 2 +- simapp/go.sum | 4 ++-- store/go.mod | 2 +- store/go.sum | 4 ++-- tests/go.mod | 2 +- tests/go.sum | 4 ++-- tools/confix/go.mod | 2 +- tools/confix/go.sum | 4 ++-- tools/cosmovisor/go.mod | 2 +- tools/cosmovisor/go.sum | 4 ++-- tools/hubl/go.mod | 2 +- tools/hubl/go.sum | 4 ++-- tools/rosetta/go.mod | 2 +- tools/rosetta/go.sum | 4 ++-- x/circuit/go.mod | 2 +- x/circuit/go.sum | 4 ++-- x/evidence/go.mod | 2 +- x/evidence/go.sum | 4 ++-- x/feegrant/go.mod | 2 +- x/feegrant/go.sum | 4 ++-- x/nft/go.mod | 2 +- x/nft/go.sum | 4 ++-- x/upgrade/go.mod | 2 +- x/upgrade/go.sum | 4 ++-- 28 files changed, 42 insertions(+), 42 deletions(-) diff --git a/client/v2/go.mod b/client/v2/go.mod index ca1c6efe96c6..c46a4e8f1c6c 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-20230227115928-12b8dd75e45f // indirect + cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 // 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 632d199dc03f..1d313b408548 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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= -cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 h1:OpmiiO3x9esYawh4WX7jLL0UzBoOfjZrx3SdM3l8lhE= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728/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 e72651905285..535fee5bc1d2 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ 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-20230227163539-b62444bab662 + cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 cosmossdk.io/x/tx v0.2.0 diff --git a/go.sum b/go.sum index 675dc9e6f454..a13769651920 100644 --- a/go.sum +++ b/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-20230227163539-b62444bab662 h1:n34laByI8YkYPnBgo6UmvOnbDgxtHjww9Ofc+r+Q3YM= -cosmossdk.io/log v0.0.0-20230227163539-b62444bab662/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 h1:OpmiiO3x9esYawh4WX7jLL0UzBoOfjZrx3SdM3l8lhE= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/simapp/go.mod b/simapp/go.mod index 469346556a56..61d0c4cefcd0 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -7,7 +7,7 @@ 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-20230227163539-b62444bab662 + cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 cosmossdk.io/tools/confix v0.0.0-20230120150717-4f6f6c00021f diff --git a/simapp/go.sum b/simapp/go.sum index 2fd2b489e970..6d9ceb0e78ad 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -200,8 +200,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-20230227163539-b62444bab662 h1:n34laByI8YkYPnBgo6UmvOnbDgxtHjww9Ofc+r+Q3YM= -cosmossdk.io/log v0.0.0-20230227163539-b62444bab662/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 h1:OpmiiO3x9esYawh4WX7jLL0UzBoOfjZrx3SdM3l8lhE= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/store/go.mod b/store/go.mod index 42ff934f3a08..b22ba082e3ed 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-20230227115928-12b8dd75e45f + cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 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 diff --git a/store/go.sum b/store/go.sum index fe6bebf6d8b7..a718307545c0 100644 --- a/store/go.sum +++ b/store/go.sum @@ -1,8 +1,8 @@ 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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= -cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 h1:OpmiiO3x9esYawh4WX7jLL0UzBoOfjZrx3SdM3l8lhE= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728/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= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= diff --git a/tests/go.mod b/tests/go.mod index 5d9dbbba2057..b7644bcb46a8 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -6,7 +6,7 @@ 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-20230227163539-b62444bab662 + cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 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-20230227103508-bbe7f8a11b44 diff --git a/tests/go.sum b/tests/go.sum index d19cd7a90b18..e8e298f3171e 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -198,8 +198,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-20230227163539-b62444bab662 h1:n34laByI8YkYPnBgo6UmvOnbDgxtHjww9Ofc+r+Q3YM= -cosmossdk.io/log v0.0.0-20230227163539-b62444bab662/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 h1:OpmiiO3x9esYawh4WX7jLL0UzBoOfjZrx3SdM3l8lhE= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/tools/confix/go.mod b/tools/confix/go.mod index ff09a9ccbe35..5cd0a85b0ec2 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-20230227115928-12b8dd75e45f // indirect + cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 // indirect cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 // indirect cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 // indirect cosmossdk.io/x/tx v0.2.0 // indirect diff --git a/tools/confix/go.sum b/tools/confix/go.sum index 93c711068925..ffc39eb61eb5 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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= -cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 h1:OpmiiO3x9esYawh4WX7jLL0UzBoOfjZrx3SdM3l8lhE= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index 4db699bb316e..5c5eb3e2bba3 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/tools/cosmovisor go 1.20 require ( - cosmossdk.io/log v0.0.0-20230227120745-e8f244012ae0 + cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 cosmossdk.io/x/upgrade v0.0.0-20230227110325-294ef34f396f github.com/otiai10/copy v1.9.0 github.com/rs/zerolog v1.29.0 diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index 48ef96de2ae5..a02371d45bad 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -198,8 +198,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-20230227120745-e8f244012ae0 h1:VPDle4a4BlwSWdyxP8ZQ8TaoYkgErycafGDcALFUT5w= -cosmossdk.io/log v0.0.0-20230227120745-e8f244012ae0/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 h1:OpmiiO3x9esYawh4WX7jLL0UzBoOfjZrx3SdM3l8lhE= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index 8b03027ba1e0..075d8df9b635 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-20230227115928-12b8dd75e45f // indirect + cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 // 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 64476c993d88..826d4a6f712a 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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= -cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 h1:OpmiiO3x9esYawh4WX7jLL0UzBoOfjZrx3SdM3l8lhE= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728/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/go.mod b/tools/rosetta/go.mod index d25eae6aa291..87203ffc1e13 100644 --- a/tools/rosetta/go.mod +++ b/tools/rosetta/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/tools/rosetta go 1.19 require ( - cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f + cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 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 diff --git a/tools/rosetta/go.sum b/tools/rosetta/go.sum index 0b23490ff9d8..74316636cb89 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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= -cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 h1:OpmiiO3x9esYawh4WX7jLL0UzBoOfjZrx3SdM3l8lhE= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/x/circuit/go.mod b/x/circuit/go.mod index dcaa7eeef1e1..b1b101d941c0 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -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-20230227115928-12b8dd75e45f // indirect + cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 // 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 ce7d0e7e5f52..96bd0f4043eb 100644 --- a/x/circuit/go.sum +++ b/x/circuit/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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= -cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 h1:OpmiiO3x9esYawh4WX7jLL0UzBoOfjZrx3SdM3l8lhE= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/x/evidence/go.mod b/x/evidence/go.mod index 227c503867e4..3ab14b580195 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -7,7 +7,7 @@ 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-20230227115928-12b8dd75e45f + cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 github.com/cometbft/cometbft v0.37.0-alpha.3 diff --git a/x/evidence/go.sum b/x/evidence/go.sum index 83b2e6132812..c2434a9e2804 100644 --- a/x/evidence/go.sum +++ b/x/evidence/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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= -cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 h1:OpmiiO3x9esYawh4WX7jLL0UzBoOfjZrx3SdM3l8lhE= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index cabe6fb558bc..7e33de021c27 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -7,7 +7,7 @@ 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-20230227115928-12b8dd75e45f + cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 github.com/cometbft/cometbft v0.37.0-alpha.3 diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index 1ba162618463..47f7c776a4b7 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= -cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 h1:OpmiiO3x9esYawh4WX7jLL0UzBoOfjZrx3SdM3l8lhE= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/x/nft/go.mod b/x/nft/go.mod index 20e3a151ffbe..3166c70e1939 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -24,7 +24,7 @@ require ( require ( cosmossdk.io/collections v0.0.0-20230214153846-b6c6e4e99177 // indirect - cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f // indirect + cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 // 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 diff --git a/x/nft/go.sum b/x/nft/go.sum index 83b2e6132812..c2434a9e2804 100644 --- a/x/nft/go.sum +++ b/x/nft/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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= -cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 h1:OpmiiO3x9esYawh4WX7jLL0UzBoOfjZrx3SdM3l8lhE= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 28206d12c8aa..5d1b8ed35a6f 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -7,7 +7,7 @@ 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-20230227115928-12b8dd75e45f + cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 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 diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index 1816732577bf..c819043b9289 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -198,8 +198,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-20230227115928-12b8dd75e45f h1:Xeak3jWo/OAvmCHYMcFozMpzvaUrMnUG3czHK6gNyi4= -cosmossdk.io/log v0.0.0-20230227115928-12b8dd75e45f/go.mod h1:FZRNfYm6Jgp+toyDR8Ek1qrmNjdsDddEQnfATMbpGYg= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728 h1:OpmiiO3x9esYawh4WX7jLL0UzBoOfjZrx3SdM3l8lhE= +cosmossdk.io/log v0.0.0-20230227204852-3535ee51c728/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-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= From 4b9db948a0b35cc27b483da680076c4b39ce898b Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 22:05:48 +0100 Subject: [PATCH 17/17] add changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f068b3f3a51..521115ff85c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -81,6 +81,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* [#15011](https://github.com/cosmos/cosmos-sdk/pull/15011) Introduce `cosmossdk.io/log` package to provide a consistent logging interface through the SDK. CometBFT logger is now replaced by `cosmossdk.io/log.Logger`. * (x/auth) [#14758](https://github.com/cosmos/cosmos-sdk/pull/14758) Allow transaction event queries to directly passed to Tendermint, which will allow for full query operator support, e.g. `>`. * (server) [#15041](https://github.com/cosmos/cosmos-sdk/pull/15041) Remove unnecessary sleeps from gRPC and API server initiation. The servers will start and accept requests as soon as they're ready. * (x/staking) [#14864](https://github.com/cosmos/cosmos-sdk/pull/14864) `create-validator` CLI command now takes a json file as an arg instead of having a bunch of required flags to it. @@ -177,6 +178,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking Changes +* [#15011](https://github.com/cosmos/cosmos-sdk/pull/15011) All functions that were taking a CometBFT logger, now take `cosmossdk.io/log.Logger` instead. * (x/auth) [#14758](https://github.com/cosmos/cosmos-sdk/pull/14758) Refactor transaction searching: * Refactor `QueryTxsByEvents` to accept a `query` of type `string` instead of `events` of type `[]string` * Pass `prove=false` to Tendermint's `TxSearch` RPC method