mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-06 13:14:24 +08:00
permit setting of verbosity from config
Signed-off-by: Matthew R. Kasun <mkasun@nusak.ca>
This commit is contained in:
parent
7152f6ccd4
commit
fa29b09aab
2 changed files with 17 additions and 1 deletions
|
@ -52,7 +52,7 @@ type ServerConfig struct {
|
|||
Platform string `yaml:"platform"`
|
||||
Database string `yaml:"database"`
|
||||
DefaultNodeLimit int32 `yaml:"defaultnodelimit"`
|
||||
Verbosity int32 `yaml:"verbosity"`
|
||||
Verbosity int `yaml:"verbosity"`
|
||||
ServerCheckinInterval int64 `yaml:"servercheckininterval"`
|
||||
AuthProvider string `yaml:"authprovider"`
|
||||
ClientID string `yaml:"clientid"`
|
||||
|
|
|
@ -90,6 +90,7 @@ func GetServerConfig() config.ServerConfig {
|
|||
services := strings.Join(GetPortForwardServiceList(), ",")
|
||||
cfg.PortForwardServices = services
|
||||
cfg.Server = GetServer()
|
||||
cfg.Verbosity = GetVerbosity()
|
||||
|
||||
return cfg
|
||||
}
|
||||
|
@ -352,6 +353,21 @@ func GetServer() string {
|
|||
return server
|
||||
}
|
||||
|
||||
func GetVerbosity() int {
|
||||
var verbosity = 0
|
||||
var err error
|
||||
if os.Getenv("VERBOSITY") != "" {
|
||||
verbosity, err = strconv.Atoi(os.Getenv("VERBOSITY"))
|
||||
if err != nil {
|
||||
verbosity = 0
|
||||
}
|
||||
} else if config.Config.Server.Verbosity != 0 {
|
||||
verbosity = config.Config.Server.Verbosity
|
||||
}
|
||||
logger.Verbosity = int(verbosity)
|
||||
return verbosity
|
||||
}
|
||||
|
||||
// IsDNSMode - should it run with DNS
|
||||
func IsDNSMode() bool {
|
||||
isdns := true
|
||||
|
|
Loading…
Add table
Reference in a new issue