make cli mode respect log.level (#2124)
Fixes #2119 Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
7be8796d87
commit
4b02dc9565
|
@ -732,6 +732,9 @@ func prefixV6() (*netip.Prefix, error) {
|
||||||
// LoadCLIConfig returns the needed configuration for the CLI client
|
// LoadCLIConfig returns the needed configuration for the CLI client
|
||||||
// of Headscale to connect to a Headscale server.
|
// of Headscale to connect to a Headscale server.
|
||||||
func LoadCLIConfig() (*Config, error) {
|
func LoadCLIConfig() (*Config, error) {
|
||||||
|
logConfig := logConfig()
|
||||||
|
zerolog.SetGlobalLevel(logConfig.Level)
|
||||||
|
|
||||||
return &Config{
|
return &Config{
|
||||||
DisableUpdateCheck: viper.GetBool("disable_check_updates"),
|
DisableUpdateCheck: viper.GetBool("disable_check_updates"),
|
||||||
UnixSocket: viper.GetString("unix_socket"),
|
UnixSocket: viper.GetString("unix_socket"),
|
||||||
|
@ -741,6 +744,7 @@ func LoadCLIConfig() (*Config, error) {
|
||||||
Timeout: viper.GetDuration("cli.timeout"),
|
Timeout: viper.GetDuration("cli.timeout"),
|
||||||
Insecure: viper.GetBool("cli.insecure"),
|
Insecure: viper.GetBool("cli.insecure"),
|
||||||
},
|
},
|
||||||
|
Log: logConfig,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue