Skip to content

Commit

Permalink
make cli mode respect log.level
Browse files Browse the repository at this point in the history
Fixes #2119

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
  • Loading branch information
kradalby committed Sep 11, 2024
1 parent 7be8796 commit f077143
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hscontrol/types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,9 @@ func prefixV6() (*netip.Prefix, error) {
// LoadCLIConfig returns the needed configuration for the CLI client
// of Headscale to connect to a Headscale server.
func LoadCLIConfig() (*Config, error) {
logConfig := logConfig()
zerolog.SetGlobalLevel(logConfig.Level)

return &Config{
DisableUpdateCheck: viper.GetBool("disable_check_updates"),
UnixSocket: viper.GetString("unix_socket"),
Expand All @@ -741,6 +744,7 @@ func LoadCLIConfig() (*Config, error) {
Timeout: viper.GetDuration("cli.timeout"),
Insecure: viper.GetBool("cli.insecure"),
},
Log: logConfig,
}, nil
}

Expand Down

0 comments on commit f077143

Please sign in to comment.