Browse Source

removed unneccesary check

0xdcarns 3 years ago
parent
commit
fc5fc3d381
2 changed files with 6 additions and 3 deletions
  1. 6 0
      logger/util.go
  2. 0 3
      netclient/config/config.go

+ 6 - 0
logger/util.go

@@ -6,6 +6,9 @@ import (
 	"strings"
 )
 
+// Verbosity - current logging verbosity of netclient
+var Verbosity = 0
+
 // MakeString - makes a string using golang string builder
 func MakeString(delimeter string, message ...string) string {
 	var builder strings.Builder
@@ -19,6 +22,9 @@ func MakeString(delimeter string, message ...string) string {
 }
 
 func getVerbose() int32 {
+	if Verbosity >= 1 && Verbosity <= 3 {
+		return int32(Verbosity)
+	}
 	level, err := strconv.Atoi(os.Getenv("VERBOSITY"))
 	if err != nil || level < 0 {
 		level = 0

+ 0 - 3
netclient/config/config.go

@@ -167,9 +167,6 @@ func ReplaceWithBackup(network string) error {
 // GetCLIConfig - gets the cli flags as a config
 func GetCLIConfig(c *cli.Context) (ClientConfig, string, error) {
 	var cfg ClientConfig
-	if c.String("version") != "" {
-		return cfg, c.String("version"), nil
-	}
 	if c.String("token") != "" {
 		tokenbytes, err := base64.StdEncoding.DecodeString(c.String("token"))
 		if err != nil {