From b64032282bd53594881bc59c180c5f4d09195ca5 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Wed, 27 Sep 2023 21:46:24 +0800 Subject: [PATCH] fix flags --- cmd/root.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 9dab48f..649fc01 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -45,7 +45,7 @@ func Execute() { } func initFuncs(cmd *cobra.Command, args []string) { - logfile := viper.GetString("logfile") + logfile := viper.GetString("log.file") if logfile != "" { file, err := os.OpenFile(logfile, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) @@ -65,7 +65,7 @@ func initFuncs(cmd *cobra.Command, args []string) { } func logLevel() error { - viper.BindEnv("log.level", "LOGRUS_LEVEL") + viper.BindEnv("log.level", "LOG_LEVEL") lvl, err := log.ParseLevel(viper.GetString("log.level")) if err != nil { return err