diff --git a/README.md b/README.md index 0aa1f5f3645eeb389453e9a2261e169ba7466b45..98a8c6b0b888063c9ffd447641f55a0d5339a191 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 b65e68cd50eba6251f4d541f2ea2277f396f308e..61901609567856e03f1c6d8324b0e372b898c74f 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 "+