diff options
Diffstat (limited to 'internal/config')
| -rw-r--r-- | internal/config/common.go | 2 | ||||
| -rw-r--r-- | internal/config/initializer.go | 19 |
2 files changed, 12 insertions, 9 deletions
diff --git a/internal/config/common.go b/internal/config/common.go index acc8e6a..255bd28 100644 --- a/internal/config/common.go +++ b/internal/config/common.go @@ -6,7 +6,7 @@ type CommonConfig struct { SSHPort int // Enable experimental features (mainly for dev purposes) ExperimentalFeaturesEnable bool `json:",omitempty"` - // LogLevel defines how much is logged. TODO: Adjust JSONschema + // LogLevel defines how much is logged. LogLevel string `json:",omitempty"` // The log strategy to use, one of // stdout: only log to stdout (useful when used with systemd) diff --git a/internal/config/initializer.go b/internal/config/initializer.go index f1a9ec4..0e725a6 100644 --- a/internal/config/initializer.go +++ b/internal/config/initializer.go @@ -72,6 +72,17 @@ func (c *initializer) transformConfig(args *Args, additionalArgs []string, common.LogStrategy = "daily" } + if args.Spartan { + args.Quiet = true + args.NoColor = true + if args.LogLevel == "" { + args.LogLevel = "ERROR" + } + } + if args.NoColor { + client.TermColorsEnable = false + } + if args.LogLevel != "" { common.LogLevel = args.LogLevel } else if args.ServersStr == "" && args.Discovery == "" { @@ -82,14 +93,6 @@ func (c *initializer) transformConfig(args *Args, additionalArgs []string, if args.SSHPort != DefaultSSHPort { common.SSHPort = args.SSHPort } - if args.NoColor { - client.TermColorsEnable = false - } - - if args.Spartan { - args.Quiet = true - args.NoColor = true - } if args.Discovery == "" && args.ServersStr == "" { // We are not connecting to any servers. |
