From 854430e617a9f5757160f60d73e7c98e86e5e6cd Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 3 Nov 2020 12:14:56 -0500 Subject: [PATCH] Add log_level CLI flag back (#7789) --- server/util.go | 1 + simapp/simd/cmd/root.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/server/util.go b/server/util.go index 3f66921d6..7118d5b8d 100644 --- a/server/util.go +++ b/server/util.go @@ -76,6 +76,7 @@ func InterceptConfigsPreRunHandler(cmd *cobra.Command) error { if err != nil { return err } + basename := path.Base(executableName) // Configure the viper instance diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index 2ffd39459..6fa3325c7 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -74,9 +74,12 @@ func Execute(rootCmd *cobra.Command) error { // and a Tendermint RPC. This requires the use of a pointer reference when // getting and setting the client.Context. Ideally, we utilize // https://github.com/spf13/cobra/pull/1118. + srvCtx := server.NewDefaultContext() ctx := context.Background() ctx = context.WithValue(ctx, client.ClientContextKey, &client.Context{}) - ctx = context.WithValue(ctx, server.ServerContextKey, server.NewDefaultContext()) + ctx = context.WithValue(ctx, server.ServerContextKey, srvCtx) + + rootCmd.PersistentFlags().String("log_level", srvCtx.Config.LogLevel, "The logging level in the format of :,...") executor := tmcli.PrepareBaseCmd(rootCmd, "", simapp.DefaultNodeHome) return executor.ExecuteContext(ctx)