Browse Source

another attempt at fixing logging

Matthew R. Kasun 3 years ago
parent
commit
e1b590d43f
3 changed files with 5 additions and 5 deletions
  1. 1 1
      config/config.go
  2. 1 1
      logger/util.go
  3. 3 3
      servercfg/serverconf.go

+ 1 - 1
config/config.go

@@ -52,7 +52,7 @@ type ServerConfig struct {
 	Platform              string `yaml:"platform"`
 	Database              string `yaml:"database"`
 	DefaultNodeLimit      int32  `yaml:"defaultnodelimit"`
-	Verbosity             int    `yaml:"verbosity"`
+	Verbosity             int32  `yaml:"verbosity"`
 	ServerCheckinInterval int64  `yaml:"servercheckininterval"`
 	AuthProvider          string `yaml:"authprovider"`
 	ClientID              string `yaml:"clientid"`

+ 1 - 1
logger/util.go

@@ -25,6 +25,6 @@ func getVerbose() int32 {
 	if Verbosity >= 1 && Verbosity <= 3 {
 		return int32(Verbosity)
 	}
-	Verbosity = servercfg.GetVerbosity()
+	Verbosity = int(servercfg.GetVerbosity())
 	return int32(Verbosity)
 }

+ 3 - 3
servercfg/serverconf.go

@@ -348,7 +348,7 @@ func GetServer() string {
 	return server
 }
 
-func GetVerbosity() int {
+func GetVerbosity() int32 {
 	var verbosity = 0
 	var err error
 	if os.Getenv("VERBOSITY") != "" {
@@ -357,12 +357,12 @@ func GetVerbosity() int {
 			verbosity = 0
 		}
 	} else if config.Config.Server.Verbosity != 0 {
-		verbosity = config.Config.Server.Verbosity
+		verbosity = int(config.Config.Server.Verbosity)
 	}
 	if verbosity < 0 || verbosity > 3 {
 		verbosity = 0
 	}
-	return verbosity
+	return int32(verbosity)
 }
 
 // IsDNSMode - should it run with DNS