Add log_level CLI flag back (#7789)

This commit is contained in:
Aleksandr Bezobchuk 2020-11-03 12:14:56 -05:00 committed by GitHub
parent 30efa5ab16
commit 854430e617
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -76,6 +76,7 @@ func InterceptConfigsPreRunHandler(cmd *cobra.Command) error {
if err != nil {
return err
}
basename := path.Base(executableName)
// Configure the viper instance

View File

@ -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 <module>:<level>,...")
executor := tmcli.PrepareBaseCmd(rootCmd, "", simapp.DefaultNodeHome)
return executor.ExecuteContext(ctx)