From 76af84fb9d21bc9f80fb81da4753978e85e74399 Mon Sep 17 00:00:00 2001
From: Benjamin Wenger <ben@elixxir.ioo>
Date: Fri, 26 Feb 2021 15:25:11 -0800
Subject: [PATCH] fixed log level flag

---
 README.md   | 2 +-
 cmd/root.go | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 0aa1f5f36..98a8c6b0b 100644
--- a/README.md
+++ b/README.md
@@ -182,7 +182,7 @@ Flags:
       --unsafe-channel-creation   Turns off the user identity authenticated
                                   channel check, automatically approving
                                   authenticated channels
-  -v, --logLevel                  Level of debugging to print (0 = info, 
+  -v, --logLevel uint             Level of debugging to print (0 = info, 
                                   1 = debug, >1 = trace). (Default info)
       --waitTimeout uint          The number of seconds to wait for messages to
                                   arrive (default 15)
diff --git a/cmd/root.go b/cmd/root.go
index b65e68cd5..619016095 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -561,12 +561,15 @@ func initLog(threshold uint, logPath string) {
 	}
 
 	if threshold>1{
+		jww.INFO.Printf("log level set to: TRACE")
 		jww.SetStdoutThreshold(jww.LevelTrace)
 		jww.SetLogThreshold(jww.LevelTrace)
 	}else if threshold == 1{
+		jww.INFO.Printf("log level set to: DEBUG")
 		jww.SetStdoutThreshold(jww.LevelDebug)
 		jww.SetLogThreshold(jww.LevelDebug)
 	}else{
+		jww.INFO.Printf("log level set to: TRACE")
 		jww.SetStdoutThreshold(jww.LevelInfo)
 		jww.SetLogThreshold(jww.LevelInfo)
 	}
@@ -619,7 +622,7 @@ func init() {
 	// will be global for your application.
 	rootCmd.PersistentFlags().UintP("logLevel", "v", 0,
 		"Verbose mode for debugging")
-	viper.BindPFlag("verbose", rootCmd.PersistentFlags().Lookup("verbose"))
+	viper.BindPFlag("logLevel", rootCmd.PersistentFlags().Lookup("logLevel"))
 
 	rootCmd.PersistentFlags().StringP("session", "s",
 		"", "Sets the initial storage directory for "+
-- 
GitLab