From 6a8e586f9d1eca54650df224fe5b7aa6df427cc6 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 3 Dec 2020 18:17:21 -0500 Subject: [PATCH] Refactor Logging using Zerolog (#8072) * init commit * server: use flags * server: godoc++ * updates * baseapp: update logging * logging updates * x/bank: update logging * logging updates * lint++ * logging updates * logging updates * logging updates * logging updates * cl++ --- simd/cmd/root.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/simd/cmd/root.go b/simd/cmd/root.go index dd6132095c88..847a31f21168 100644 --- a/simd/cmd/root.go +++ b/simd/cmd/root.go @@ -6,8 +6,10 @@ import ( "os" "path/filepath" + "github.com/rs/zerolog" "github.com/spf13/cast" "github.com/spf13/cobra" + tmcfg "github.com/tendermint/tendermint/config" tmcli "github.com/tendermint/tendermint/libs/cli" "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" @@ -79,7 +81,8 @@ func Execute(rootCmd *cobra.Command) error { ctx = context.WithValue(ctx, client.ClientContextKey, &client.Context{}) ctx = context.WithValue(ctx, server.ServerContextKey, srvCtx) - rootCmd.PersistentFlags().String("log_level", srvCtx.Config.LogLevel, "The logging level in the format of :,...") + rootCmd.PersistentFlags().String(flags.FlagLogLevel, zerolog.InfoLevel.String(), "The logging level (trace|debug|info|warn|error|fatal|panic)") + rootCmd.PersistentFlags().String(flags.FlagLogFormat, tmcfg.LogFormatJSON, "The logging format (json|plain)") executor := tmcli.PrepareBaseCmd(rootCmd, "", simapp.DefaultNodeHome) return executor.ExecuteContext(ctx)