From eed4a50adf117038720d4c77eba5008b06989b4c Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 4 Jul 2023 14:56:16 +0200 Subject: [PATCH 1/3] fix: `properly use `--trace` flag` --- CHANGELOG.md | 2 ++ go.mod | 2 +- go.sum | 4 ++-- server/util.go | 8 +++----- simapp/go.mod | 2 +- simapp/go.sum | 4 ++-- tests/go.mod | 2 +- tests/go.sum | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23d4f7319a7c..50053470b68c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (server) [#]() Properly use `--trace` flag (before it was setting the trace level instead of displaying the stacktraces). + ### API Breaking Changes * (types/math) [#16040](https://github.com/cosmos/cosmos-sdk/pull/16798) Remove aliases in `types/math.go` (part 2). diff --git a/go.mod b/go.mod index e0bfac1ca308..00ce6df87055 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - cosmossdk.io/log v1.1.0 + cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9 cosmossdk.io/math v1.0.1 cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c cosmossdk.io/x/tx v0.8.0 diff --git a/go.sum b/go.sum index 2ebc864fb186..6e8c27521f48 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.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= +cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9 h1:x7z13ODRzKyJaprGAbKjU4SKAsodNgxmNJEwPDCNejU= +cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= diff --git a/server/util.go b/server/util.go index 37293317dd55..40842f4b2c36 100644 --- a/server/util.go +++ b/server/util.go @@ -190,15 +190,13 @@ func CreateSDKLogger(ctx *Context, out io.Writer) (log.Logger, error) { } opts = append(opts, log.FilterOption(filterFunc)) - - case ctx.Viper.GetBool("trace"): // cmtcli.TraceFlag - // 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`. - opts = append(opts, log.LevelOption(zerolog.TraceLevel)) default: opts = append(opts, log.LevelOption(logLvl)) } + // Check if the CometBFT flag for trace logging is set and enable stack traces if so. + opts = append(opts, log.TraceOption(ctx.Viper.GetBool("trace"))) // cmtcli.TraceFlag + return log.NewLogger(out, opts...), nil } diff --git a/simapp/go.mod b/simapp/go.mod index 4ff484b98ad3..7331a532acc0 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -7,7 +7,7 @@ require ( cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860 cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/log v1.1.0 + cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9 cosmossdk.io/math v1.0.1 cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c cosmossdk.io/tools/confix v0.0.0-20230613133644-0a778132a60f diff --git a/simapp/go.sum b/simapp/go.sum index 2ba3ad7ee8a0..8724ebe0ecba 100644 --- a/simapp/go.sum +++ b/simapp/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.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= +cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9 h1:x7z13ODRzKyJaprGAbKjU4SKAsodNgxmNJEwPDCNejU= +cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= diff --git a/tests/go.mod b/tests/go.mod index 7905c7d62d72..156052ae2a35 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -8,7 +8,7 @@ require ( cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - cosmossdk.io/log v1.1.0 + cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9 cosmossdk.io/math v1.0.1 cosmossdk.io/simapp v0.0.0-20230309163709-87da587416ba cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c diff --git a/tests/go.sum b/tests/go.sum index 2d5d4aed0c0e..217c3e432a9c 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.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= +cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9 h1:x7z13ODRzKyJaprGAbKjU4SKAsodNgxmNJEwPDCNejU= +cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= From d03f9d3cba933def25adea5032a409b2801d2faf Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 4 Jul 2023 14:57:31 +0200 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50053470b68c..b1f1c21bf9ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,7 +46,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes -* (server) [#]() Properly use `--trace` flag (before it was setting the trace level instead of displaying the stacktraces). +* (server) [#16827](https://github.com/cosmos/cosmos-sdk/pull/16827) Properly use `--trace` flag (before it was setting the trace level instead of displaying the stacktraces). ### API Breaking Changes From ad17ca437fbabdcea0309a49390c3be470d58fb1 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 4 Jul 2023 19:08:08 +0200 Subject: [PATCH 3/3] 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 fca732bb81c7..ca6bf919d286 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9 + cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca cosmossdk.io/math v1.0.1 cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c cosmossdk.io/x/tx v0.8.0 diff --git a/go.sum b/go.sum index 282766f7f1d1..59aaaf242076 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.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9 h1:x7z13ODRzKyJaprGAbKjU4SKAsodNgxmNJEwPDCNejU= -cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca h1:msenprh2BLLRwNT7zN56TbBHOGk/7ARQckXHxXyvjoQ= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= diff --git a/simapp/go.mod b/simapp/go.mod index fe5a8d7b3db6..e190edfd65f8 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -7,7 +7,7 @@ require ( cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860 cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9 + cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca cosmossdk.io/math v1.0.1 cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c cosmossdk.io/tools/confix v0.0.0-20230613133644-0a778132a60f diff --git a/simapp/go.sum b/simapp/go.sum index 11fc89809580..ac1840625067 100644 --- a/simapp/go.sum +++ b/simapp/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.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9 h1:x7z13ODRzKyJaprGAbKjU4SKAsodNgxmNJEwPDCNejU= -cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca h1:msenprh2BLLRwNT7zN56TbBHOGk/7ARQckXHxXyvjoQ= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= diff --git a/tests/go.mod b/tests/go.mod index 98a1cdf33b86..d332d7f8e1e9 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -8,7 +8,7 @@ require ( cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9 + cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca cosmossdk.io/math v1.0.1 cosmossdk.io/simapp v0.0.0-20230309163709-87da587416ba cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c diff --git a/tests/go.sum b/tests/go.sum index 212c83546d93..34183eb4994d 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.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9 h1:x7z13ODRzKyJaprGAbKjU4SKAsodNgxmNJEwPDCNejU= -cosmossdk.io/log v1.1.1-0.20230704114334-8c4ca0ce90d9/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca h1:msenprh2BLLRwNT7zN56TbBHOGk/7ARQckXHxXyvjoQ= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI=