diff options
| author | Paul Buetow <paul@buetow.org> | 2021-10-02 13:44:27 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2021-10-02 19:03:12 +0300 |
| commit | 86ec83754e0ee7153ad55091f7b6da448bc529c5 (patch) | |
| tree | 155687b0addb21a97a10a5ebb77928fadc3c62c3 /internal/config | |
| parent | 12c79f68bb5bda6673819d7b754820ecfe6d08ff (diff) | |
add dcat test
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. |
