From ea67ee86702d764a120d96657a271b2eb28326f3 Mon Sep 17 00:00:00 2001 From: Julian Date: Wed, 12 Jul 2023 14:43:35 +0200 Subject: [PATCH] GROW-942 Setup logging level on badges (#612) * setup logging lv on badges * refactor setting logging lv on badges --- protocol/badgegenerator/badgeserver.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/protocol/badgegenerator/badgeserver.go b/protocol/badgegenerator/badgeserver.go index f5eb0080e4..b0f7ae8c8f 100644 --- a/protocol/badgegenerator/badgeserver.go +++ b/protocol/badgegenerator/badgeserver.go @@ -60,6 +60,11 @@ func CreateBadgeGeneratorCobraCommand() *cobra.Command { logFormat := viper.GetString(flags.FlagLogFormat) utils.JsonFormat = logFormat == "json" + logLevel, err := cmd.Flags().GetString(flags.FlagLogLevel) + if err != nil { + utils.LavaFormatFatal("failed to read log level flag", err) + } + utils.LoggingLevel(logLevel) RunBadgeServer(cmd, v) @@ -99,7 +104,6 @@ func RunBadgeServer(cmd *cobra.Command, v *viper.Viper) { if err != nil { utils.LavaFormatFatal("Error in open listener", err) } - // set up the grpc server grpcUrl := v.GetString(GrpcUrlEnvironmentVariable) chainId := v.GetString(LavaChainIDEnvironmentVariable)